Re: 'shutdown' faq ...
- From: Havoc Pennington <hp redhat com>
- To: Michael Meeks <michael ximian com>
- Cc: gtk-devel-list gnome org
- Subject: Re: 'shutdown' faq ...
- Date: 19 Apr 2001 12:46:50 -0400
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 ?
> 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.
] [Thread Prev