Qt State Machine Framework QFinalState - Qt 5 Design Patterns

แชร์
ฝัง
  • เผยแพร่เมื่อ 13 ม.ค. 2025

ความคิดเห็น • 2

  • @MaceUA
    @MaceUA 4 ปีที่แล้ว +1

    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.

    • @VoidRealms
      @VoidRealms  4 ปีที่แล้ว +2

      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)