Another technique is to have an "owner" object.

Nothing refers to the owner, but the owner refers to the eggs (or  
trees or whatever it is).

Once the owner is niled, it calls .Dispose on your objects. This  
makes it impossible to get leaks, if you always allocated your  
objects with an owner attached, and the objects cannot become part of  
any relationship without becoming attached to something with an owner.

I think RB's XMLDocument does something like that??



On 11 Apr 2007, at 17:17, realbasic-nug- 
[EMAIL PROTECTED] wrote:

> Date: Wed, 11 Apr 2007 07:30:45 -0600
> From: [EMAIL PROTECTED]
> Subject:
> To: [email protected]
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain;
>
> On Apr 11, 2007, at 12:11 UTC, Daniel Stenning wrote:
>
>> It is good to have this new feature, but since Parent-Child
>> relationships are found all over the place ( at least in my code they
>> are ) and the scenarios presented seem to me anything but "rare" - am
>> I alone in thinking that the way this feature was implemented is a
>> "fudge" ? :
>
> No, but I would say that extensive use of WeakRef in your situation
> would be a kludge and (I predict) will cause you grief.  I would
> recommend a Close (or ReleaseData or Cleanup or whatever) pattern
> instead.

--
http://elfdata.com/plugin/
"String processing, done right"


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to