[746] in The GTK GIMP ToolKit mailing list archive
[gtk-list] Re: g_list memory leaks
daemon@ATHENA.MIT.EDU (Owen Taylor)
Sat Aug 16 23:55:43 1997
From: Owen Taylor <owt1@cornell.edu>
To: gtk-list@redhat.com
In-reply-to: Your message of "Sat, 16 Aug 1997 20:38:09 PDT."
<Pine.LNX.3.96.970816202946.5347A-100000@cascadia.a42.com>
Date: Sat, 16 Aug 1997 23:56:37 -0400
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com
> (Sorry for all the code) Notice that the g_list 'layer_list' is never
> freed with g_list_free. Is this because it is used directly by the
> gtk_list, or is it just a memory leek? Oh, and could someone also explain
> the suspend_gimage_notify++/--?
I think its fine. If you look at the implementation o
gtk_list_insert_items, you'll find that the list passed in is inserted
into a linked list of child widgets without a copy. Whether it's good
design is another question ... this is the type of thing that can lead
to problems with reference counting in Perl bindings, for example;
though this case isn't really a problem since there already should be
code to translate the GList into a native Perl list.
Without looking at the GIMP source code, I think the ++/-- stuff just
keeps lots of unnecessary updates from happening in callbacks for Layer
list items. The callbacks probably check:
if (suspend_gimage_notify == 0)
{
[ do whatever needs needs to be done ]
}
Using ++/-- allows multiple simultaneous suspensions.
But maybe you wanted to know _what_ was being suspended ...
Regards,
Owen
--
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null