whats the difference between dispose and finalizie?



Hi,

I'm trying to port may app to gnome2 but am stuck on how to destroy the
objects.
Firstly it seems that 
objectClass->destroy = myDestroyFunc
should change to 
objectClass->finalize = myDestroyFunc
but then there is an objectClass->dispose so perhaps destroy has just
changed name? Or dose the dispose function serve some other purpose?

And secondly if my object is also a widget in stead of which ever of the
above is correct I have to go back to the old way of doing things and
overload GtkObject->destory and do all my destroying in there !?

My reason for thinking this is this line in the porting doc on the
dotplan page

<quote>
Also, ::destroy implementations have to release object references that
the object holds. Code in finalize() implementations such as:

if (object->adjustment) {
  gtk_object_unref (object->adjustment);
  object->adjustment = NULL;
}
                  

have to be moved into the ::destroy implementations.
</quote>

Please help I'm very confused
-- 

rob




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