Removing obsolete classes (5976)
Pavel Krivanek
squeak1 at continentalbrno.cz
Sat Aug 21 15:32:18 UTC 2004
This will safely remove all instances of obsolete classes from Squeak image
5976
| wrong |
wrong := Association allInstances
select: [ :a | (a key = #DefaultMap) and: [a value asString beginsWith:
'an AnObsolete'] ].
wrong do: [ :a | a value: (SMSqueakMap allInstances first) ].
Smalltalk garbageCollect.
and this will remove obsolete classes. Is it a safe way?
| set |
set := WeakSet newFrom: Smalltalk obsoleteClasses.
set do: [ :class | class becomeForward: nil. ].
Smalltalk garbageCollect.
Pavel
More information about the Squeak-dev
mailing list
|