Re: GTK signals and widget destruction/disposal/finalization
- From: Federico Mena Quintero <federico ximian com>
- To: Havoc Pennington <hp redhat com>
- Cc: GTK Dev List <gtk-devel-list gnome org>, GTK App Dev List <gtk-app-devel-list gnome org>
- Subject: Re: GTK signals and widget destruction/disposal/finalization
- Date: Wed, 09 Feb 2005 15:29:33 -0600
On Tue, 2005-02-08 at 20:57 -0500, Havoc Pennington wrote:
> > - Between the time a widget is destroyed, and the time that "dispose"
> > is called, is it possible for other signals to be serviced? That is,
> > is it best to explicitly disconnect signal handlers before destroying
> > a widget, if you don't want signal handlers called in the interim
> > before finalization?
>
> Should not be needed.
One caveat: consider this situation:
1. You get a reference to an object, which possibly has other references
2. You connect to signals on that object
3. You unref the object
If the object has remaining references after (3) and it emits signals,
then your handlers will get called, since you didn't disconnect them.
If your code expects the object to be gone, it will get in trouble :)
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]