[Newbies] Orphaned objects

Herbert König herbertkoenig at gmx.net
Mon Mar 10 08:00:19 UTC 2008


Hello Blake,


B> The problem he's having is that he's got orphaned objects from  
B> experimenting, and he can't get rid of them. They're sketchmorphs. If I
B> add them to the world, they'll show up, and I can then delete them with
B> the "X" but they simply vanish from the world, while persisting.

start with:
Smalltalk garbageCollect.
Smalltalk forgetDoIts
then
myObjectClass allInstances inspect

You get an inspector on an array, there you right click on every
entry, choosing "objects pointing to this value".

You get another array whose elements you have to inspect. Every Ivar
that points to a myObjectClass has to be set to in the inspector.

Sometimes they don't let you, then it might help to:
myIvar: nil
in the inspector.

Also on the Swiki search for "cleaning up junk".

Happy hunting!

A tip from the sidelines:

myObjectClass allInstances do: [:o | o doStuff].
takes a long time.

If you know the container, submorphs and checking for the class might
prove much faster.

Cheers

Herbert                            mailto:herbertkoenig at gmx.net



More information about the Beginners mailing list