summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@symbio.com>2017-09-26 15:00:52 +0300
committerJanne Kangas <janne.kangas@qt.io>2017-12-01 09:12:39 +0000
commit7bd33163d4762f52cb913902c38c00b7dafff329 (patch)
tree23361ae1b84f357b60aead125bed4081d4751dc7
parentd19aa455a4a8052520439e4796b02217fc7e924f (diff)
Fix crash when deleting several objects with parent-descendant relation
Task-ID: QT3DS-542 Change-Id: Ife1c148a3cc8f36d81de642de8f914da4ff93533 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
index ecb62fdb..fedbb782 100644
--- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
+++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp
@@ -1196,10 +1196,16 @@ public:
QT3DS_ASSERT(false);
return;
}
- if (m_AssetGraph.IsExist(theInstance))
+ if (m_AssetGraph.IsExist(theInstance)) {
RecursiveDeleteInstanceInSceneGraph(theInstance);
- else
+ } else if (IsInstance(theInstance)) {
+ // When deleting multiple instances that have a parent-descendant
+ // relationship, it is possible that an instance not in asset graph
+ // has already been recursively deleted in this loop.
+ // We cannot do blind delete for out-of-graph items without checking
+ // if they exist.
DoDeleteInstance(theInstance);
+ }
}
}