in reply to How can I call other objects from my object during DESTROY
Otherwise, you might have to add a separate not-quite-destructor phase. In Jellybean, anything that needs to shut down cleanly is expected to have a method named _cleanup(). When the Engine shuts down, it calls _cleanup() on the parent Container. Containers call this on all of their children.
If we could count on an order of destruction at the end of the program, this wouldn't be necessary. It's a small price to pay for reliable semantics, though.
|
|---|