The following code, which I use purely for demostration, produces a
memory leak of the entire pixbuf that I load into a Gtk.Image.

protected virtual void OnButton1Clicked (object sender, System.EventArgs
e)
{
        Gdk.Pixbuf pixbuf = IconTheme.Default.LoadIcon
(IconTheme.Default.ListIcons (null)[x], 256, 0);
        image2.Pixbuf = pixbuf;
        pixbuf.Dispose ();
        x++;
}

image2 is a Gtk.Image.  I tied the method to the pushing of a button and
pressed it a lot.  After pressing it 20 or 30 times, my memory usage had
gone from 3MB to 20MB.

I use similar code to this inside of GNOME Do.  The application works,
but it seems to leak pixbufs.  Unfortunately for GNOME Do, this is a LOT
of pixbufs.  CellRendererPixbufs seem to have the same issue, but its to
a smaller degree for us since those are tiny pixbufs.

_______________________________________________
Gtk-sharp-list maillist  -  Gtk-sharp-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/gtk-sharp-list

Reply via email to