[Q] Safe way of removing class from system

Ramon Leon ramonleon at cox.net
Mon Nov 6 06:06:10 UTC 2006


>>
>> Is there safe way of removing class from system without making
>> ObsoleteClass? What I found is check whether there're instances of the
>> class and remove all methods, instance variables and class variables,
>> and make its superclass as Object, then remove the class and if  there's
>> ObsoleteClass, then I use becomeForward: like this: anObsoleteClass
>> becomeForward: Object.
>>
>> I'm not sure my way of removing is correct thing.
>>
>> Thanks in advance.

You can also just find, and eliminate all remaining references

SomeClass allInstances do: [:each | PointerFinder on: each].

or if you have obsolete classes hanging around, look them up as well

Smalltalk obsoleteClasses do: [:each | PointerFinder on: each].

Once you rid yourself of those hanging references, just do a 
garbageCollect and you should be good to go.  I'd be careful with 
become, you shouldn't need it.

Ramon Leon
http://onsmalltalk.com




More information about the Squeak-dev mailing list