Do you really need to manually delete m_states in the destructor? It seems that the Qt's parent-child system should handle that on its own, since the states are the children of the state machine object, and thus should be implicitly deleted when their parent is destroyed.
In this example m_states is a list of pointers the pointers will be deleted if they have a parent, if not they will remain in memory, I delete them out of habit (raii)
Do you really need to manually delete m_states in the destructor? It seems that the Qt's parent-child system should handle that on its own, since the states are the children of the state machine object, and thus should be implicitly deleted when their parent is destroyed.
In this example m_states is a list of pointers the pointers will be deleted if they have a parent, if not they will remain in memory, I delete them out of habit (raii)