On 26 Oct 2012, at 21:41, Paul DeBruicker <pdebruic@gmail.com> wrote:
2. If I have two objects with accessors:
Object subclass: #ObjectA instanceVariableNames: 'objectB' classVariableNames: '' poolDictionaries: '' category: 'Temp'
Object subclass: #ObjectB instanceVariableNames: 'objectA' classVariableNames: '' poolDictionaries: '' category: 'Temp'
and create an instance of each in a workspace and then set them up:
|a b| a:=ObjectA new. b:=ObjectB new. a objectB: b. b objectA: a.
and close the workspace then those instances of ObjectA & ObjectB will never be garbage collected, correct? Its my understanding that I'd need to nil out the instance variables of both instances to have them GCd as they both refer strongly to each other. Is that right?
That's a circular reference and should be no problem for the garbage collector. Unless something else holds either a or b, like the workspace, an inspector, a debugger. -- Sven Van Caekenberghe http://stfx.eu Smalltalk is the Red Pill