summaryrefslogtreecommitdiffstats
path: root/src/runtime/Qt3DSQmlEngine.cpp
diff options
context:
space:
mode:
authorJere Tuliniemi <jere.tuliniemi@qt.io>2019-11-04 10:50:40 +0200
committerJere Tuliniemi <jere.tuliniemi@qt.io>2019-11-04 11:44:04 +0200
commit8803caed932cb4c5627310223a72a137ea5c99f3 (patch)
tree4abfdba40ea93ca89f2da1200104f76a71983761 /src/runtime/Qt3DSQmlEngine.cpp
parent92e34b4a3f0448026da7934938e67aa8f759e601 (diff)
Fix crash when queueing attributes with delayed loading
Task-number: QT3DS-3996 Change-Id: I24b96b4806cb24a92b199562d3f033ead47696d1 Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtime/Qt3DSQmlEngine.cpp')
-rw-r--r--src/runtime/Qt3DSQmlEngine.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/runtime/Qt3DSQmlEngine.cpp b/src/runtime/Qt3DSQmlEngine.cpp
index c7e6e88..e5378a6 100644
--- a/src/runtime/Qt3DSQmlEngine.cpp
+++ b/src/runtime/Qt3DSQmlEngine.cpp
@@ -608,14 +608,16 @@ void CQmlEngineImpl::Initialize()
bool queueAttributeChange(TElement *target, const char *attName, const char *value)
{
- TElement *componentElement = target->GetActivityZone().GetItemTimeParent(*target);
- TComponent *component = static_cast<TComponent *>(componentElement);
- // Queue changes to elements inside components that have not been activated even once
- if (component->GetCurrentSlide() == 0) {
- IPresentation *presentation = target->GetBelongedPresentation();
- presentation->GetComponentManager().queueChange(componentElement, target,
- attName, value);
- return true;
+ if (target->m_BelongedPresentation->GetActivityZone()) {
+ TElement *componentElement = target->GetActivityZone().GetItemTimeParent(*target);
+ TComponent *component = static_cast<TComponent *>(componentElement);
+ // Queue changes to elements inside components that have not been activated even once
+ if (component->GetCurrentSlide() == 0) {
+ IPresentation *presentation = target->GetBelongedPresentation();
+ presentation->GetComponentManager().queueChange(componentElement, target,
+ attName, value);
+ return true;
+ }
}
return false;
}