[Glass] Weird problem with class instance variable

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Tue Aug 25 13:33:26 PDT 2015


Mariano,

That is indeed odd behavior ... I would be suspicious of multiple 
versions of the class ... take a look at the oop of the class that you 
are sending the message to and the oop of the class you are inspecting ...

Other than that I can't imagine the cause ... one step at a time though:)

Dale

On 08/25/2015 01:03 PM, Mariano Martinez Peck via Glass wrote:
> Hi guys,
>
> I define a classInstVars: called 'Instances' to keep track of new 
> persistent instances in my class FaBackgroundProcess. Of course, I 
> implement #new to add those there.
>
> But I am having a very strange issue now. I have this accessor:
>
> FaBackgroundProccess class >> instances
> ^ Instances ifNil: [ Instances := OrderedCollection new ]
> If I execute:
>
> FaBackgroundProcess instances ->>>>>  anOrderedCollection( )
>
> I get an empty collection (which is what I expect). However, if I 
> inspect the class FaBackgroundProcess and see the slot for 'Instances' 
> I see lots of instances of FaBackgroundProcess! (when I expect to see 
> same as the answer of #instances, that is, empty) And those instances 
> are really alive as they prevent GC of other objects.
>
> So...what is going on????  I attach an screenshot with all the pieces. 
> Any help is really welcome since I am lost.
>
> Thanks in advance,
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150825/6007988d/attachment.html>


More information about the Glass mailing list