aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmldata_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-05-29 12:18:31 +0200
committerLars Knoll <lars.knoll@digia.com>2013-05-29 15:54:26 +0200
commitda79a51d955d701b458b410b80c2a7585f1333be (patch)
tree196f7fe4ef8b11fab1333cedbfd7f5d4a6e025b5 /src/qml/qml/qqmldata_p.h
parent5998ab3d4d111a536eb44e74aa901aa103b0bfc3 (diff)
Fix failing tst_qqmlecmascript::deleteRootObjectDuringCreation unit test
Respect the rootObjectInCreation flag in QQmlData. Centralize the checking code for that through the places in the engine where it is checked, along with the indestructible flag. Change-Id: Ie977b34ac8d070f6dcd7bab11a95dd27ca25145e Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src/qml/qml/qqmldata_p.h')
-rw-r--r--src/qml/qml/qqmldata_p.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/qml/qqmldata_p.h b/src/qml/qml/qqmldata_p.h
index 98407e53b5..568a43e36e 100644
--- a/src/qml/qml/qqmldata_p.h
+++ b/src/qml/qml/qqmldata_p.h
@@ -200,6 +200,13 @@ public:
}
}
+ static bool keepAliveDuringGarbageCollection(const QObject *object) {
+ QQmlData *ddata = get(object);
+ if (!ddata || ddata->indestructible || ddata->rootObjectInCreation)
+ return true;
+ return false;
+ }
+
bool hasExtendedData() const { return extendedData != 0; }
QHash<int, QObject *> *attachedProperties() const;