Re: Where do I hook in a GObject's finalize method?



John Palmieri <johnp martianrock com> writes:
> 
> I am a bit confused with the way GObjects should be finalized.  All of
> the GObjects and GtkObjects I have looked at so far ignore the GTypeInfo
> structure's finalize entrys by sending in NULL and instead set
> object_class->finalize = some_object_finalize; in the init_class
> method.  
> 
> Which is the correct way to handle this? In the type info or the
> class_init method?  Also when should I use the base_init and
> base_finalize elements in the GTypeInfo structure?

You want to ignore base_init and base_finalize (basically the best way
to treat gtype.h and gobject.h is that if you don't see a feature used
in GTK or other example code, you don't care about it).

My book had an explanation of the base_init thing back in the day,
with reference to GtkObject but I think for GObject it's similar.
I don't remember offhand what it's for but I'm quite confident you
don't need it. ;-)

Havoc



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