After more investigation, I can ensure root cause. Current problem:
1. To state_machine_(scoped_ptr), we use internal parameter deleted_ to block some action after state_machine_ was deleted. But only when destructed function was called, deleted_ can be set to true. This is a bug. After state_machine_ was released, any internal internal parameter can be changed.
2. When state_machine_ was destroyed, do not stop all actions related to state_machine_.
Need find a way to stop all actions but not use deleted_ to block actions.
After more investigation, I can ensure root cause. Current problem: (scoped_ ptr), we use internal parameter deleted_ to block some action after state_machine_ was deleted. But only when destructed function was called, deleted_ can be set to true. This is a bug. After state_machine_ was released, any internal internal parameter can be changed.
1. To state_machine_
2. When state_machine_ was destroyed, do not stop all actions related to state_machine_.
Need find a way to stop all actions but not use deleted_ to block actions.