Re: GObject and Gtk+ Finalization



Eric Lemings <eric b lemings lmco com> writes:
> 
> In Gtk+ 1.2, the GtkObject class has a three-step process for releasing
> objects: shutdown, destroy, and finalize.  In GLib 2.0, the GObject
> class only has two steps: shutdown and finalize.
> 
> What happened to destroy?  Did the paradigm change?
> 

Yes, as of GTK+ 2.0 "destroy" is considered a feature of GtkWidget,
essentially. GtkObject is pretty much an obsolete node in the
inheritance graph, though it will continue to exist for compatability.

So for example, Inti (a C++ binding) exports this inheritance tree:

  Object (GObject)
   |      |    
 Widget Adjustment  

i.e. no GtkObject equivalent.

Also, GObject has no "floating" flag, so that is also considered a
GtkWidget feature (though Inti adds a floating flag to Inti::Object, 
for consistency).

Some consequences are that all new code with GtkObject that should
move to GObject later should ref/sink the object in the contructor to
strip the floating flag, and should do nothing in the destroy handler.

Havoc




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