Re: Memory problems with gdk_pixbuf

John Coppens wrote:
On Mon, 06 Jun 2005 14:34:59 -0400
Tristan Van Berkom <tvb gnome org> wrote:

 img_item = gnome_canvas_item_new(root,
               "pixbuf", pxb,
               "x", 0.0, "y", 0.0,
               "width", pxb_w, "height", pxb_h,

You could try:
(gdb) watch ((GObject *)pxb)->ref_count

Thanks Tristan.

Apparently, inside gnome_canvas_item_new, the ref_count gets incremented
three times (to 4), and decremented again to 2, which is fine. The unref
decrements again to 1, which is also correct.

The sentence:


Does not destroy the pxb item - the ref_count is not changed to 0... I
scanned over the gnomecanvas.c code, but I cannot find any code for
unreferencing the pixbuf... But then I'm not a great programmer and not
faniliar with the gnome insides.

Should I report this as a bug?

If the canvas item does `g_object_ref ()' in it's
set_property() method (or if setting the property results
in a reference increment), then the old pixbuf should be
unreffed when setting a new one & the current pixbuf
should be unreffed in the finalize or dispose method.

If the canvas item doesn't hold a reference to the pixbuf or
if it doesn't balance its references to the pixbuf,
then it is a bug, yes.


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