Question about memory in GTK+2.x....



Hello i had a quick question about allocating widgets in GTK+2.x...
I haven't gotten into /alot/ of programming with 2.x yet, but i thought i remembered a "gtk_destroy", type function to destroy objects (widgets) created dynamically in 1.2 ... I.e. :

GtkWidget * window = gtk_window_new(GTK_TOPLEVEL_WINDOW);
............
gtk_destroy(window); /* could have been gtk_destroy_object(window) , or similar IIRC */
............

Now i don't see an equivilant function for 2.x releases, maybe i just missed it... I've seen references to some *_unref_* type functions, but not sure if that's what i should be using, or if once the reference count hits 0 if i still have to free the memory myself.

In some of the FAQ's i noticed a question asking why Gtk\Glib leaked memory, but that seemed to have more to do with using Glibs memory allocation functions, not allocating
widgets...

So is there Garbage Collection in 2.x that handles the allocation of widgets specifically ? Or some equivalant to it, that keeps me from having to go through and free up all those
widgets i used ? Or is there something i'm missing ?

Thx again in advance, ....FrankM....





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