Skip to content

Commit

Permalink
qmlui: workaround 3d fixture items deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallegari committed May 3, 2024
1 parent ed21c72 commit d8ff203
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
13 changes: 7 additions & 6 deletions qmlui/mainview3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,11 @@ void MainView3D::resetItems()
{
it.next();
SceneItem *e = it.value();
//if (e->m_headItem)
// delete e->m_headItem;
//if (e->m_armItem)
// delete e->m_armItem;
delete e->m_goboTexture;
// delete e->m_rootItem; // TODO: with this -> segfault
delete e->m_selectionBox;
// delete e->m_rootItem; // TODO: with this -> segfault
e->m_rootItem->setProperty("enabled", false); // workaround for the above
delete e;
}

//const auto end = m_entitiesMap.end();
Expand Down Expand Up @@ -1502,8 +1500,11 @@ void MainView3D::removeFixtureItem(quint32 itemID)

SceneItem *mesh = m_entitiesMap.take(itemID);

delete mesh->m_rootItem;
delete mesh->m_goboTexture;
delete mesh->m_selectionBox;
delete mesh->m_rootTransform;
// delete mesh->m_rootItem; // this will cause a segfault
mesh->m_rootItem->setProperty("enabled", false); // workaround for the above

delete mesh;
}
Expand Down
10 changes: 0 additions & 10 deletions qmlui/qml/fixturesfunctions/3DView/3DView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -323,16 +323,6 @@ Rectangle
objectName: "scene3DEntity"
Component.onCompleted: contextManager.enableContext("3D", true, scene3d)

/*
OrbitCameraController
{
id: camController
camera: sceneEntity.camera
linearSpeed: 40.0
lookSpeed: 300.0
}
*/

// Global elements
Camera
{
Expand Down

0 comments on commit d8ff203

Please sign in to comment.