Re: GObject destruction

Release only non-NULL references and always set referenced
object pointers to NULL when you release them.  This is
simple, consistent, and it works equally well when the
referenced objects may be unset or they may be set, unset,
and swapped arbitrarily during object's lifetime.

My question is really about how to check for multiple invocation, without having to add a 'dispose' attribute to every class or subclass I write, if that is possible somehow. Gtk+ seems to make the parent GtkObject or GtkWidget class handle the dispose, then the subclasses do some magic, but they don't have a 'dispose' attribute,


After some more thinking I see that you answered exactly what I needed to know 8).


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