aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-03-23 13:18:04 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-23 08:04:08 +0100
commit91f9f123eb67bbdb2a0e65df6f29c6833635679b (patch)
treeacbf962f29f663c2f1110d75b5a35763ad754677 /src/qml/qml/qqmlincubator.cpp
parentb63ce68f316c91b0a3107d3d20e160628f5cefef (diff)
Prevent the root object from being garbage collected.
Passing the root object as a return value from a C++ function could cause the indestructible flag to be set to false. Change-Id: Ib70c666f0d0ffbb48bca1996c2517fbccafa5dc1 Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r--src/qml/qml/qqmlincubator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index aa9777d89e..fad2ae2f28 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -293,8 +293,9 @@ void QQmlIncubatorPrivate::incubate(QQmlVME::Interrupt &i)
if (result) {
QQmlData *ddata = QQmlData::get(result);
Q_ASSERT(ddata);
+ //see QQmlComponent::beginCreate for explanation of indestructible
ddata->indestructible = true;
-
+ ddata->explicitIndestructibleSet = true;
q->setInitialState(result);
}