diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 09:35:30 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2010-03-02 09:36:45 (GMT) |
commit | 3b8cad8be96d7791e8ca8305609d1155ec093b80 (patch) | |
tree | f3c4314baf8632a25a1d5a3767d6f8fd6514d7c3 /src/declarative/qml/qdeclarativedeclarativedata_p.h | |
parent | f1412745126db129445a368525f7ec05b20a0885 (diff) | |
download | Qt-3b8cad8be96d7791e8ca8305609d1155ec093b80.zip Qt-3b8cad8be96d7791e8ca8305609d1155ec093b80.tar.gz Qt-3b8cad8be96d7791e8ca8305609d1155ec093b80.tar.bz2 |
Don't return QDeclarativeDeclarativeData for a deleting object
This was causing crashes in the qmldesigner.
Diffstat (limited to 'src/declarative/qml/qdeclarativedeclarativedata_p.h')
-rw-r--r-- | src/declarative/qml/qdeclarativedeclarativedata_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativedeclarativedata_p.h b/src/declarative/qml/qdeclarativedeclarativedata_p.h index 2c92419..a7a73bc 100644 --- a/src/declarative/qml/qdeclarativedeclarativedata_p.h +++ b/src/declarative/qml/qdeclarativedeclarativedata_p.h @@ -103,7 +103,10 @@ public: static QDeclarativeDeclarativeData *get(const QObject *object, bool create = false) { QObjectPrivate *priv = QObjectPrivate::get(const_cast<QObject *>(object)); - if (priv->declarativeData) { + if (priv->wasDeleted) { + Q_ASSERT(!create); + return 0; + } else if (priv->declarativeData) { return static_cast<QDeclarativeDeclarativeData *>(priv->declarativeData); } else if (create) { priv->declarativeData = new QDeclarativeDeclarativeData; |