diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2016-11-10 13:02:20 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2016-11-16 10:29:54 +0000 |
commit | 79e308da8dd303070e989280f940a8bd6a274fcc (patch) | |
tree | 4644b73b485bf802c7d5784196825c9c1daac6eb /src/plugins/sceneparsers/gltf/gltfimporter.cpp | |
parent | ca4a58f3783472c7a1c4f8a6b900b813a6146911 (diff) |
Fix GLTFImporter crash on loading second scene
GLTFImporter caches raw pointers, which could very well be invalid
by the time the second load happens, so clear the caches immediately
after the load is finished.
Task-number: QTBUG-57038
Change-Id: I0381f25b08bbbb1a397ba59fe9ef5be8ecbfcc36
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/plugins/sceneparsers/gltf/gltfimporter.cpp')
-rw-r--r-- | src/plugins/sceneparsers/gltf/gltfimporter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/sceneparsers/gltf/gltfimporter.cpp b/src/plugins/sceneparsers/gltf/gltfimporter.cpp index 12a475aef..62a309a2f 100644 --- a/src/plugins/sceneparsers/gltf/gltfimporter.cpp +++ b/src/plugins/sceneparsers/gltf/gltfimporter.cpp @@ -236,8 +236,6 @@ bool GLTFImporter::setJSON(const QJsonDocument &json ) m_json = json; m_parseDone = false; - cleanup(); - return true; } @@ -469,6 +467,8 @@ Qt3DCore::QEntity* GLTFImporter::scene(const QString &id) child->setParent(sceneEntity); } + cleanup(); + return sceneEntity; } |