<div class="gmail_quote">On Mon, Jul 14, 2008 at 11:42 AM, Todd Blanchard <<a href="mailto:tblanchard@mac.com">tblanchard@mac.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
So how do you make a weak reference? You stick a WeakArray in as a holder. So in your parent/child objects you would write something like:<br>
<br>
Node>>parent<br>
^ parent ifNotNil: [parent first] ifNil: [parent]<br>
<br>
Node>>parent: p<br>
parent := p ifNotNil: [WeakArray with: p] ifNil: [p]<br>
<br>
thus using a WeakArray as a holder for the parent.<br>
<br>
When a weak reference gets garbage collected, its weak references are set to nil first.</blockquote><div><br></div><div>Thank you! This is what I wanted to know; I'll give this a try, and see how it works for me...</div>
<div><br></div><div>So many Classes, so little time...</div><div><br></div><div>Rob</div><div><br></div></div>