Last updated at 2:57 pm UTC on 16 January 2006
The following code snippet removes all unsent messages in an image. Be aware that there are methods which are called manually; they are removed as well. Within the method body of #removeAllUnSentMessages there is literal array defined with methods not to remove. You may add your own there as well.
The operation is dangerous and Squeak may easily hang.
[Smalltalk removeAllUnSentMessages > 0]
[Smalltalk unusedClasses do: [:c | (Smalltalk at: c) removeFromSystem]].
Smalltalk allClassesDo: [:c | c zapOrganization].