[Oberon] ETH Oberon/Gadgets: System Freeze in unloading module

Felix Friedrich friedrich at gsf.de
Mon Aug 19 14:52:23 CEST 2002


>Gadgets.Insert BasicGadgets.NewButton
>
>to Insert a button somewhere.
>Then I execute
>
>System.Free BasicGadgets~

Don't be so cruel to the poor Button. You have stolen its Handler. ;-) 
Seriously: The Problem is: When freeing a Module, Oberon checks if there 
are still other Modules depending on that module but it cannot check if 
Objects are still using any Allocated Memory in that Module. In that 
special case the allocated Memory was the Handler and moreover any 
type-checks and type-casts could't work since the Module did not exist any 
more (after successful freeing it) etc.

So the "solution" is: Do not System.Free a Module when its Objects are 
still displayed, since they are not deallocated and the Handler is called 
any time a Display.Broadcast (or update message) is sent (which is the case 
when new Viewers like a Trap-View are opened.)

Felix.





More information about the Oberon mailing list