Well, "Smalltalk cleanUp:except:" does exactly that, it iterates over all classes. :-) The call "UserInterfaceTheme cleanUp: true" was just an ad-hoc, oversimplified example for programmers to try out.
I just added a new test for the themes. If the integrity of a theme is broken, one can just browse all senders of #userInterfaceTheme and debug. I claim that it is quite simple to diagnose. :)
Best, Marcel Am 18.09.2017 11:12:52 schrieb Stéphane Rollandin lecteur@zogotounga.net:
As for your GC concerns: Can you construct a more elaborate example? If your environment experiences a severe memory issue, you should just try to clean-up the system like in the release process:
I have no problem in my images, it's just by perusing the code that I saw that #userInterfaceTheme requires a specific handling.
What worries me is not the normal usage of #userInterfaceTheme, which works fine, it is how technically easy it is to mess things up, although I do not see that happening too often or at all actually. But if it happens sometime, somewhere, it will be a silent bug difficult to diagnose.
BTW I see that the #cleanUp: method will indeed reset all stacks in hard-coded subclasses of UserInterfaceTheme, but it will not do so for possibly existing other subclasses. So if I create my own MuOInterfaceTheme for example, I will also need to monkey-patch #cleanUp:.. Maybe we should iterate long #allSubclasses?
Stef