<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 29 April 2018 at 21:35, Tm Jhnsn <span dir="ltr"><<a href="mailto:digit@sonic.net" target="_blank">digit@sonic.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I've tried to learn how to properly use Weak collections for purposes of circular references, but I'm not sure I fully understand -- not enough to actually use it in my implementation.<br>
<br>
I made a fairly large project a couple of years ago where I ended up with a lot of stale information in the image because I had circular references keeping objects from being cleared by GC.  I learned my lesson, and addressed the situation by building a 'release' mechanism and explicitly tearing down objects when I was done with them.<br></blockquote><div><br></div><div>Note that since the VM uses a tracing garbage collector rather than reference counting, circular references *only* between objects 'a' and 'b' will not in themselves prevent them both being garbage collected.  They will only stick around if one of them has a chain of references through from a root object.</div><div><br></div><div>cheers -ben </div></div></div></div>