[gtkmm] resource file styles and x server resource leak
- From: pks timing com
- To: gtkmm-list gnome org
- Subject: [gtkmm] resource file styles and x server resource leak
- Date: Mon, 14 Apr 2003 14:01:49 -0600
When running the following program, built with gtkmm 1.2, with the
resource file that follows the code, I observe my x server growing
4K every ten to fifteen seconds. When I terminate the program the x
server's memory usage returns to what it was before the program was
executed.
For what it is worth, I'm running FreeBSD 4.5 and leak rate
described above applies to an amd-k6 265.27-MHz with 64MB of
ram, running an svga x server. My p4 with a much beefier video
card also leaks when this program is run, at longer intervals
and much larger increments (236K at a time).
Any and all input on this matter will be appreciated.
Thank you,
Patrick Schweiger
//------------------------------------------------------------------------
//-- chgcolor.cc
#include <gtk--.h>
void
fake_expose(Gtk::Window *win)
{
GdkEventExpose evt;
evt.type = GDK_EXPOSE;
evt.window = win->get_window();
evt.area.x = evt.area.y = 0;
evt.area.width = win->width();
evt.area.height = win->height();
win->expose_event(&evt);
}
gint
change_name(gpointer data)
{
static int i = 0;
static const char *snames[] = { "WinOperate", "WinStandby" };
Gtk::Window *win = (Gtk::Window *)data;
i = (i ? 0 : 1);
win->set_name(snames[i]);
fake_expose(win);
return 1;
}
int
main(int argc, char *argv[])
{
Gtk::Main kit(argc, argv);
gtk_rc_parse("./ui.rc");
Gtk::Window win(GTK_WINDOW_TOPLEVEL);
win.show_all();
gtk_timeout_add(250, change_name, &win);
kit.run();
return 0;
}
###########################################################################
#### ui.rc
style "operate"
{
bg[NORMAL] = { 1.00, 1.00, 1.00 }
}
style "standby"
{
bg[NORMAL] = { 0.50, 0.50, 0.50 }
}
widget "WinOperate" style "operate"
widget "WinStandby" style "standby"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]