Michael G Schwern wrote:
> Hmmm... an object which contains a method reference which contains a
> referent to itself.
>
Yup. I don't know why some people think that circular references are complex
;-)
>
> > Something like this would be nice in a class that creates method
> > references--it would simply need to keep a list of referred objects, and
> > have an explicit destructor that iterates through the references and
undefs
> > them. Of course, calling the destructor would be optional where no
circular
> > reference exists.
>
> Yes, you could keep a list/hash of what you created (as weak
> references) and explicitly destroy them.... but I don't think that
> would help.  Consider the following...
>
> <following deleted...>
>
> Which doesn't solve the problem... and I don't have any better ideas.
>
No, neither do I. So far I've been undef'ing method references semi-manually
(since there are specific event callback hooks in any widget, I just need to
undef these), but this isn't Lazy.

Maybe a flash of inspiration will come over Christmas...


Reply via email to