Re: gtk_object_remove_all_data ?
- From: Vlad Harchev <hvv hippo ru>
- To: Vladimir Tsichevski <wowa jet msk su>
- Cc: Florent Devin lifl fr, gtk-list gnome org
- Subject: Re: gtk_object_remove_all_data ?
- Date: Tue, 19 Sep 2000 15:48:47 +0500 (SAMST)
On Tue, 19 Sep 2000, Vladimir Tsichevski wrote:
> >
> >Hi,
> >In gtk, you can associate data to an object like this :
> >gtk_object_set_data (object, string, pointer);
> >
> >But I want to know if it is possible to have a function which remove
> >all data from an object without doing a loop on all associate data ?
> >I ask this because I have a program that create its own association
> >between a canvas and pointer to canvas_item, but when I remove all
> >canvas_item the association still exist, so I have to remove all my
> >data
> >Regards,
> >-- Florent
> >
>
> This IMHO should do
>
> g_datalist_init (&object->object_data);
>
> or, which is equivalent
>
> object->object_data = NULL;
Wouldn't this leak memory taken by strings used as keys and the data itself?
> But, I'm afraid, you'd better do not do such things at all, since
> doing that, you remove any properties that someone else has set (for
> example, glade assign names for objects using this property list).
I agree here.
> Vladimir V. Tsichevski
> senior expert
>
Best regards,
-Vlad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]