Re: gtk_signal_emit & refcounting



On Fri, 2001-08-31 at 09:20, John Tunison wrote:
> Out of curiousity, if gtk_signal_emit refs correctly ...
> 
> static void
> gtk_signal_real_emit (GtkObject object ...)
> {
>   gtk_object_ref (object);
>   ...
> 
>   gtk_object_unref (object);
> }
> 
> Why does some code ref and unref, wrapped around a signal emission?  (Like gtk_widget_hide, but I've seen it elsewhere too.) 

To try to make sure that the object doesn't get destroyed during
the signal emission, leaving gtk+ holding a dangling pointer.

-JT





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