GObject finalizers



Hi all,

sorry if it's a FAQ but, searching the archives, I couldn't find any
helpful pointers.

When calling g_object_unref(), refcount is decremented. If it reaches 0,
GObjectClass->finalize(Gobject *) is called. And that's a damn good
thing ;)

If I subclass GObject with a class containg dynamically allocated
instance vars, I will need to provide my own finalize() to get rid of
them, and chain the call to "GObjectClass->finalize()".

The question is how to provide my own instance finalizer and register
it...

Thank you
--
Cedric




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