aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.cpp
diff options
context:
space:
mode:
authorCharles Yin <charles.yin@nokia.com>2012-04-23 14:11:31 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-01 03:25:01 +0200
commit78f1d2679242c84efe6d8eb763c13caf58efe19d (patch)
tree6e1735eac79f1665b6f76e80e650b43c6000a32d /src/qml/qml/qqmlincubator.cpp
parent0795351f7c252f1eed97253f64e2d5839ad8a975 (diff)
Prevent object being delete by GC before object is fully created
Add a new flag inCreation to QQmlData. Set it to true when a top-level object begins creation, and back to false when initial creation is finished and the object has been marked indestructible. In the GC callback function, if inCreation is true, skip the GC and make a weak reference for next GC loop. Change-Id: I4ec82864c52f6be0c3e6ef892474dd77d835e152 Reviewed-by: Michael Brasser <michael.brasser@nokia.com> Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r--src/qml/qml/qqmlincubator.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index fad2ae2f28..817e7b89e7 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -296,6 +296,7 @@ void QQmlIncubatorPrivate::incubate(QQmlVME::Interrupt &i)
//see QQmlComponent::beginCreate for explanation of indestructible
ddata->indestructible = true;
ddata->explicitIndestructibleSet = true;
+ ddata->inCreation = false;
q->setInitialState(result);
}