Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-54184

Assert when deleting entities

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.7.0
    • Qt3D
    • None
    • Windows

    Description

      I am getting the following assert when I delete an entity that have children :

      ASSERT: "m_entries[index].m_counter == handle.counter()" in file c:/Users/qt/work/qt/qt3d/src/core/resources/qhandlemanager_p.h, line 170
      

      It doesn't happens on the first delete but after few.
      I can get it in our application by using undo/redo, because it delete the object and recreate it.

      I was able to fix it by deleting all children of the root entity of object with the following code :

          void    releaseModel(Qt3DCore::QNode& model)
          {
              QEntity*    entity = dynamic_cast<QEntity*>(&model);
      
              if (entity)
              {
                  QComponentVector    components = entity->components();
      
                  foreach (QComponent* component, components)
                  {
                      entity->removeComponent(component);
                      delete component;
                  }
              }
      
              QNodeVector nodes = model.childNodes();
      
              foreach (QNode* node, nodes)
              {
                  releaseModel(*node);
                  delete node;
              }
          }
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            e0150566 Janne Koskinen
            flamaros Xavier Bigand
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes