Re: gtk_object_remove_all_data ?



"Florent.Devin" <Florent Devin lifl fr> writes:

> Havoc Pennington writes:
>  > 
>  > Vladimir Tsichevski <wowa jet msk su> writes: 
>  > > After a one more dig into the sources I found the right call is
>  > > 
>  > >   g_datalist_clear(&object->object_data);
>  > > 
>  > 
>  > Note that doing this is not allowed with any GTK object (and probably
>  > not with canvas items either). object_data is a private field.
> Note that it is not allowed but works.
>  > 
>  > If you do this to a GtkWidget, than GTK will break, GTK uses object
>  > data on widgets. You can only remove data that you explicitly set.
> 
> Doing this GTK does not break (at least for the moment) but all signal
> connected to this object are down. 

Not only are they removed, but memory allocated to store them
will be leaked.

Also, things will break now if you are doing DND on the widget,
or have set the style, etc.

You cannot remove other people's data, period. Havoc's suggestion
of storing a list in object data is a good one.

Regards,
                                        Owen





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