aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2011-11-02 14:28:02 +0000
committerQt by Nokia <qt-info@nokia.com>2011-11-04 11:27:52 +0100
commitf9261feb16d02e985982dd46783ea54c2cfce91b (patch)
tree205743bcd164628f882aa35580fd136384a28acb /tests/auto/declarative/qdeclarativeecmascript/testtypes.h
parent0dd867535bebf6db673d4f03959e62e94ff35ba2 (diff)
Skip the captured properties step in bindings
Objects and notifiers in the capturedProperties list were not guarded which can lead to crashes if they're deleted prior to the binding completing. Now the notifiers are connected to and guarded immediately to prevent this. Change-Id: I912e323c52bf6169fb5077e552d5d38d9aa7faec Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/testtypes.h')
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
index af4225c8da..9fbbd5052b 100644
--- a/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
+++ b/tests/auto/declarative/qdeclarativeecmascript/testtypes.h
@@ -1229,6 +1229,26 @@ private:
QList<QPoint> m_pointList; // not a supported sequence type
};
+class MyDeleteObject : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QObject *nestedObject READ nestedObject NOTIFY nestedObjectChanged);
+ Q_PROPERTY(int deleteNestedObject READ deleteNestedObject NOTIFY deleteNestedObjectChanged);
+
+public:
+ MyDeleteObject() : m_nestedObject(new MyQmlObject) {}
+
+ QObject *nestedObject() const { return m_nestedObject; }
+ int deleteNestedObject() { delete m_nestedObject; m_nestedObject = 0; return 1; }
+
+signals:
+ void nestedObjectChanged();
+ void deleteNestedObjectChanged();
+
+private:
+ MyQmlObject *m_nestedObject;
+};
+
void registerTypes();
#endif // TESTTYPES_H