aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllanguage/testtypes.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2014-03-15 10:03:02 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-15 16:00:38 +0100
commitaf41170bc5e4c1be194bb9bbe883b00c2f7062b7 (patch)
tree60d7d2a502972ccc96c9cab0893de194a89078dc /tests/auto/qml/qqmllanguage/testtypes.h
parent3affc261aaa12105dbad60bfa7014126ce4dfcca (diff)
Fix crash on shutdown with states
When populating deferred properties, we must not set the rootObjectInCreation flags on the root context and (consequently) on any sub-objects objects created when initializing deferred properties. Doing so otherwise will end up us incorrectly linking QQmlContextData together, causing QQmlData::linkedContext to point to iself and crash on exit upon deletion. Task-number: QTBUG-37484 Change-Id: Ia5dc92a04e0f66499f15fbac10f14859d387b021 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/qml/qqmllanguage/testtypes.h')
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h
index a1e2b76bd1..6ed363e363 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.h
+++ b/tests/auto/qml/qqmllanguage/testtypes.h
@@ -1104,6 +1104,23 @@ class CustomBindingParser : public QQmlCustomParser
virtual void setCustomData(QObject *object, const QByteArray &data);
};
+class RootObjectInCreationTester : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QObject *subObject READ subObject WRITE setSubObject FINAL)
+ Q_CLASSINFO("DeferredPropertyNames", "subObject");
+public:
+ RootObjectInCreationTester()
+ : obj(0)
+ {}
+
+ QObject *subObject() const { return obj; }
+ void setSubObject(QObject *o) { obj = o; }
+
+private:
+ QObject *obj;
+};
+
void registerTypes();
#endif // TESTTYPES_H