On Sun, 2003-06-08 at 16:12, Tarun Ramakrishna Elankath wrote: > Hi all, > > I am new to Gtk and have been reading up on GObject and GType. What I > have failed to understand is why is it that the GTypeInfo structure > fails to provide a field for instance finalizer functions ? We have > fields for specifying class initialization, class finalization, instance > initialization functions but *not* for instance finalization. > > For specifying an instance finalization function, one needs to assign it > to the finalize member of the GObjectClass in the instance init > function. And in addition, make sure that this user-defined finalization > function also calls the finalize function of the parent class object. > > Is this the only way to do it ? Have I misunderstood something here ? I think probably the more appropriate question is why the instance-init function isn't just another function in the vtable. The vtable is where functions that operate on instances generally live. I think the answer to that is just history ... it's always been that way both in GObject and in GtkObject before that. Regards, Owen