Re: Memory problems with gdk_pixbuf



On Tue, 07 Jun 2005 17:13:16 +0200
Maciej Katafiasz <ml mathrick org> wrote:

Dnia 06-06-2005, pon o godzinie 21:11 -0300, John Coppens napisaÅ:
The sentence:

     gtk_object_destroy(GTK_OBJECT(img_item));

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.

This is correct. Back in GGAD days, it would actually release the
object, however in GObject 2.0 things were changed, and destroy no
longer releases the object, merely calls its destructor. So if you have
any outstanding references, you need to unref them separately for object
to get freed.

Hi Maciej.

I'm confused. The GGAD (GTK+/Gnome Application Development) is the
"official GNOME programming manual" from the developer pages at Gnome. If
this manual is not updated, shouldn't there be a LARGE warning that is
doesn't apply to the 2.x series of things?

Is there some document that describes exactly those differences?

The 'GNOME Canvas Library Reference Manual' for gnome 2.2 describes how
canvasitems are made ('new') but not how they are destroyed, and what
happens to the objects they own.

Thanks,
John



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