On Sat, 09 Aug 2008 18:18:40 +0000
dhk <dhkuhl optonline net> wrote:
Referencing the widgets is what I'm trying to do. So, are you
saying, the function is ok without any freeing? Also, am I
decrementing the reference count? I don't see it.
You will need to free the list: your mistake was in trying to free its
contents. As I said, I do not think that you need to decrement any
reference counts on the widgets, but if you are in doubt you should
look at the source code (by which I meant, look at the GTK+ source
code).
To understand GTK+ memory management more generally, try this:
http://library.gnome.org/devel/gtk/stable/GtkObject.html
and as further background, this:
http://library.gnome.org/devel/gobject/stable/gobject-The-Base-Object-Type.html
You should generally never call g_free() on any object derived from
GObject/GInitiallyUnowned/GtkObject (which includes anything derived
from GtkWidget), as memory and lifetime management is done by reference
counting.
Chris