Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to properly delete Entity loaded by EntityLoader?
Forum Updated to NodeBB v4.3 + New Features

How to properly delete Entity loaded by EntityLoader?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 379 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VictorT
    wrote on 1 Jun 2021, 10:30 last edited by VictorT 6 Jan 2021, 10:31
    #1

    Hello everyone!
    Faced the following problem. I load dynamically an Entity from external QML file using EntityLoader but sometimes it crashes with following error

    `ASSERT: "!node->parentEntity() || (!parentHandle.isNull() && m_nodeManagers->renderNodesManager()->data(parentHandle))" in file E:\Qt\Qt5\qt5.15.2\qt3d\src\render\backend\entity.cpp, line 207"

    It definetly has to do something with wrong fontend/backend synchromization.
    I've tryed:

    • setting parent to null before loading new entity
    • setting enabled property to false (before loading new entity)
    • explicitly calling 'destroy()': causes error 'Invalid attempt to destroy() an indestructible object'
    • something else (don't remember what)

    Is there any correct way to remove Entity without crashing the backend?
    Any help appreciated!

    K 1 Reply Last reply 1 Jun 2021, 13:47
    0
    • V VictorT
      1 Jun 2021, 10:30

      Hello everyone!
      Faced the following problem. I load dynamically an Entity from external QML file using EntityLoader but sometimes it crashes with following error

      `ASSERT: "!node->parentEntity() || (!parentHandle.isNull() && m_nodeManagers->renderNodesManager()->data(parentHandle))" in file E:\Qt\Qt5\qt5.15.2\qt3d\src\render\backend\entity.cpp, line 207"

      It definetly has to do something with wrong fontend/backend synchromization.
      I've tryed:

      • setting parent to null before loading new entity
      • setting enabled property to false (before loading new entity)
      • explicitly calling 'destroy()': causes error 'Invalid attempt to destroy() an indestructible object'
      • something else (don't remember what)

      Is there any correct way to remove Entity without crashing the backend?
      Any help appreciated!

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 1 Jun 2021, 13:47 last edited by
      #2

      @VictorT said in How to properly delete Entity loaded by EntityLoader?:

      Faced the following problem. I load dynamically an Entity from external QML file using EntityLoader but sometimes it crashes with following error

      Please supply a minimal code snippet.

      setting parent to null before loading new entity

      The parent of what?

      explicitly calling 'destroy()': causes error 'Invalid attempt to destroy() an indestructible object'

      Where does this come from?

      Is there any correct way to remove Entity without crashing the backend?

      Simply deleting the object with deleteLater, however I have this feeling that's not where the problem is. The enitity loader is where the ownership is typically, so just switching the source should be enough.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0

      1/2

      1 Jun 2021, 10:30

      • Login

      • Login or register to search.
      1 out of 2
      • First post
        1/2
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved