[Newbies] Re: Proper object removal

Rob Rothwell r.j.rothwell at gmail.com
Wed Jun 4 13:20:05 UTC 2008

On Wed, Jun 4, 2008 at 8:41 AM, Klaus D. Witzel <klaus.witzel at cobss.com>

> {'this ', 'and ', 'that'} collect: [:each | ].
>>> Smalltalk garbageCollect.
>>> {thisContext tempAt: 1} inspect
>>> first line: create some object and make a temp var point to it.
>>> second line: invoke GC.
>>> third line: see what's still pointed to by the temp var.

So...if I do line 1, then line 3, should I see items in the Array, or just
the Array itself.

This is all very interesting, because in my application I am creating lots
of collections of objects maintaining parent/child pointers, and I have
obviously just done it WRONG!

Chasing pointers and objects is showing me that when I remove objects from
my collections, I need to do that "all the way down," I think...

Thank you for helping my brain move in the right direction.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/beginners/attachments/20080604/591f4435/attachment.htm

More information about the Beginners mailing list