diff options
Diffstat (limited to 'src/assetutils/qquick3druntimeloader.cpp')
| -rw-r--r-- | src/assetutils/qquick3druntimeloader.cpp | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/assetutils/qquick3druntimeloader.cpp b/src/assetutils/qquick3druntimeloader.cpp index ed332802..04cd638f 100644 --- a/src/assetutils/qquick3druntimeloader.cpp +++ b/src/assetutils/qquick3druntimeloader.cpp @@ -176,26 +176,26 @@ void QQuick3DRuntimeLoader::loadSource() break; } - emit statusChanged(); - emit errorStringChanged(); - - if (m_status != Status::Success) { + if (m_status == Status::Success) { + // We create a dummy root node here, as it will be the parent to the first-level nodes + // and resources. If we use 'this' those first-level nodes/resources won't be deleted + // when a new scene is loaded. + m_root = new QQuick3DNode(this); + m_imported = QSSGRuntimeUtils::createScene(*m_root, scene); + m_assetId = scene.id; + m_boundsDirty = true; + m_instancingChanged = m_instancing != nullptr; + updateModels(); + // Cleanup scene before deleting. + scene.cleanup(); + } else { m_source.clear(); emit sourceChanged(); - return; } - // We create a dummy root node here, as it will be the parent to the first-level nodes - // and resources. If we use 'this' those first-level nodes/resources won't be deleted - // when a new scene is loaded. - m_root = new QQuick3DNode(this); - m_imported = QSSGRuntimeUtils::createScene(*m_root, scene); - m_assetId = scene.id; - m_boundsDirty = true; - m_instancingChanged = m_instancing != nullptr; - updateModels(); - // Cleanup scene before deleting. - scene.cleanup(); + emit statusChanged(); + emit errorStringChanged(); + } void QQuick3DRuntimeLoader::updateModels() |
