Re: GtkWindow destroy problem



On 5 Sep 2001, Havoc Pennington wrote:

> 
> Darin Adler <darin bentspoon com> writes: 
> > Perhaps some GTK expert will correct me, but this is how I understand it.
> > 
> 
> No, you're right.
> 
> I still think the finalize handler for GtkObject should g_warning if
> the floating flag is set, and the finalize handler for GtkWindow
> should complain if the window is still in the toplevel list.
> Then people would be forced to actually understand how this works (in
> the cases where they are doing it wrong).

not in GtkObject, since this is valid code (apart from GTK_TYPE_OBEJCT
being abstract):
o = g_object_new (GTK_TYPE_OBJECT, NULL);
gtk_object_unref (o);
the object will be correctly destroyed but never had someone resetting its
floating flag (e.g. for a widget that means it got never added to a container).

for GtkWindow i don't see how you'd condition the warning, as
its always finalize which removes the window from the toplevel list.
(i'd not be opposed to warn about what's martin doing, but there's
no real way to detect someone screwing refcounts).

>   
> Havoc
> 

---
ciaoTJ





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