Re: 'shutdown' faq ...



Michael Meeks <michael ximian com> writes:
> 	I have a feeling that I'd heard something about this, and it's
> probably a feature, but can someone confirm that it is correct for a
> GtkObject's shutdown signal to be called twice during a GtkObject's
> destruction sequence ?
> 
> 	From:
> 		gtk_object_destroy
> 		g_object_last_unref
> 
> 	What best to do with gnome-canvas-item's shutdown method is not
> over clear to me just now, a quick hack is just allow it to be run
> multiple times I suppose.
> 

"destroy" now just means "please drop references" and can be called
multiple times. (For now it even _is_ always called multiple times,
but that's just to turn up bugs, probably won't be true in the end.)

Objects should remain totally usable/safe until the finalize method is
called, in principle.

Looking at canvas_item_shutdown, I don't understand why it's overriding
shutdown instead of destroy. So I may be missing an important detail.

But in general, it looks like the "detach from the canvas" code should
be safe to run more than once and should be in destroy; you might move
the g_free (item->xform) into finalize.

Havoc





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