Allow that statechart to catch a destroy_instance event from anywhere. When this event is invoked, the statechart still has some time to clean up. The statechart raises the destroyed event when finished, and the destruction can continue.
This will likely profit from having a (sane) default: when the destroy_instance event is received (and not caught anywhere else in the SC), a destroyed event is raised immediately.
Note that this could be abused to make an "unkillable object", so there should also be some kind of a timeout mechanism: if the statechart has not raised the destroyed event to CD within some time bound, it is forcefully removed.
Allow that statechart to catch a `destroy_instance` event from anywhere. When this event is invoked, the statechart still has some time to clean up. The statechart raises the `destroyed` event when finished, and the destruction can continue.
This will likely profit from having a (sane) default: when the `destroy_instance` event is received (and not caught anywhere else in the SC), a `destroyed` event is raised immediately.
Note that this could be abused to make an "unkillable object", so there should also be some kind of a timeout mechanism: if the statechart has not raised the `destroyed` event to CD within some time bound, it is forcefully removed.
Allow that statechart to catch a
destroy_instance
event from anywhere. When this event is invoked, the statechart still has some time to clean up. The statechart raises thedestroyed
event when finished, and the destruction can continue.This will likely profit from having a (sane) default: when the
destroy_instance
event is received (and not caught anywhere else in the SC), adestroyed
event is raised immediately.Note that this could be abused to make an "unkillable object", so there should also be some kind of a timeout mechanism: if the statechart has not raised the
destroyed
event to CD within some time bound, it is forcefully removed.