Re: GTK 1.2 - gtk_object_unref() trouble



on 9/27/00 11:39 AM, Martin Baulig at martin home-of-linux org wrote:

>>> Btw. I found this while I was wondering why
>>> 
>>>     plug = bonobo_plug_new (<whatever>);
>>> 
>>>     gtk_widget_destroy (plug);
>>> 
>>> works without problems but
>>> 
>>>     plug = bonobo_plug_new (<whatever>);
>>> 
>>>     gtk_object_unref (plug);
>>> 
>>> yields
>>> 
>>>     Gtk-CRITICAL **: file gtkobject.c: line 1179 (gtk_object_unref):
>>>     assertion `object->ref_count > 0' failed.
>> 
>> That's because top level containers like GtkWindow and GtkWindow subclasses
>> are owned by the top level container list. They unref themselves when they
>> are destroyed.
> 
> So the correct thing to do is to change this gtk_object_unref () to
> gtk_object_destroy () ?

Yes.

    -- Darin





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