Re: g_free() vs gtk_widget_destroy()



From: Jeff Franks <jcf tpg com au>

g_free() frees raw memory allocated with g_new().

Ah! So I should never use g_free() g_new() in normal context, right?

gtk_widget_destroy()
marks a widget for destruction when its reference count
reaches zero. It

mmm... so I call gtk_widget_destroy() and GTK internally take trace of all
references to it, so when there is no more references GTK destroy it, right?

also emits a "destroy" that is meant to any reference
holders to a to drop the reference it's holding.

I don't think to understand this... :(
Can you tell me more about this?

And another one: if I have a container with a widget into it, before destroy
the container should I destroy the contained widget or it is destroyed automatically?

Thanks again!




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