F.A.Q. » F.A.Q. » Destroying objects remotely from another task


Destroying objects remotely from another task

2038 Betrachtungen
Seite: 1
MichaelKamsties
avatar
Administrator
75 Beiträge

Destroying objects remotely from another task

Having two active classes Controller and ToBeDestroyed, it is not possible to destroy ToBeDestroyed by just calling ToBeDestroyed_Destroy() from Controller. It would not always remove the waiting timeouts and events from the queues, which could cause an undefined behavior. However, there is a simple workaround how Controller can get ToBeDestroyed to destroy itself. Controller can send en evDestroy to ToBeDestroyed . The statechart of ToBeDestroyed must in any state be able to reacto to that event, which is possible by surrounding the actual statechart with one root state. The transition triggered by evDestroy must connect the root state (defaultState) to the termination connector.


Seite: 1

Currently Online:

There is nobody online.

Welcome to our latest member: lammils