Re: [gtk-list] Re: Proxy objects and circular garbage
- From: Vollmer Marius <mvo zagadka ping de>
- To: gtk-list redhat com
- Subject: Re: [gtk-list] Re: Proxy objects and circular garbage
- Date: 15 Apr 1998 19:55:31 +0200
Michael Beach <firstname.lastname@example.org> writes:
> So you are ok about the proxy getting GCed, even if the gtk+ object it
> proxies for is still live?
Yes, I was until you made me aware of the properties problem you
I really have to think this whole issue over again.
> > A similar circle will arise when attaching Scheme values to an
> > GtkObject with gtk_object_set_data/gtk_object_get_data but I don't
> > think that it is always the right thing to detach these datas upon a
> > "destroy" request. Fortunately, Guile has other means to attach
> > arbitrary key/value pairs to objects and we should use these instead.
> So are you saying that the data attached in this fashion is dropped by
> the gtk+ object when it is destroyed?
No, this will not happen. It would have to happen when exposing
gtk_object_set_data to Scheme.
> But when you say there are other ways of attaching key/value pairs to
> objects, I assume you are talking about attaching these to the proxy
> object? However wouldn't there be a problem with this, in that the gtk+
> object only maintains a weak link to the proxy, and so the proxy (and
> associated key/value pairs) could go away if all other refs were lost?
Right! I haven't considered this.
There is onw more problem with the current scheme: a GtkObject that
has a signal handler connected to it that forms a cycle will only be
collected when it is explicitely destroyed. That is, it is possible
to leak GtkObjects and all the stuff that they carry with them. This
is not good.
A solution for Guile could be to only mark the SCM stuff that hangs
off of a GtkObject while marking the object itself.
I'm coming back to you when I have made my mind up.
] [Thread Prev