Mem leak in pixbuf engine


i think i found a pixmap leak in the pixbuf engine. The following small
program simply shows an continually updated progressbar. I also tried it
with other widgets, but it seems to be a progressbar problem.

If i watch it in xrestop with a simple color theme all seems ok, but if
i switch to a pixmap theme the number of allocated pixmaps increases
dramatically. It seems that they don't get freed.

I've tried to track it down myself, but that goes a little bit to deep
into gtk internals...


#include <gtk/gtk.h>

update_progressbar (GtkWidget *prog)
  static float frac = 0.0;

  frac += 0.01;
  if (frac >= 1.0)
    frac = 0.0;
  gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (prog), frac);

  return TRUE;

main (int argc, char** argv)
  GtkWidget *win, *prog;
  gtk_init (&argc, &argv);

  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  prog = gtk_progress_bar_new ();
  gtk_window_set_default_size (GTK_WINDOW (win), 600, -1);

  gtk_container_add (GTK_CONTAINER (win), prog);
  gtk_widget_show_all (win);

  g_timeout_add (5, (GSourceFunc) update_progressbar, prog);
  gtk_main ();
  return 0;

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]