aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-02-06 21:15:54 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-13 01:57:56 +0100
commit68dabbf62b867e092a2860e5cde1813768176a3e (patch)
tree78844a9c3235c9424b2b22c2b5f385ba7fbb2491
parentebef5a5a68d2432425109bd3e4945988c638786d (diff)
[new compiler] Fix context ownership for anonymous components
When instantiating an anonymous component, we must also set the context ownership to true. Fixes garbage collection of item view delegates, where when the destructor run, their context wasn't cleared properly and child items would re-evaluate bindings that use "parent" with null. Change-Id: I8c67c679c12ce987a0dec405571647270373881c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index e2063a979f..d7ce968508 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -991,7 +991,7 @@ QObject *QmlObjectCreator::createInstance(int index, QObject *parent)
QQmlData *ddata = QQmlData::get(instance, /*create*/true);
ddata->setImplicitDestructible();
- if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject) {
+ if (static_cast<quint32>(index) == qmlUnit->indexOfRootObject || ddata->rootObjectInCreation) {
if (ddata->context) {
Q_ASSERT(ddata->context != context);
Q_ASSERT(ddata->outerContext);