diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-01-10 15:42:01 +0100 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-01-11 11:03:35 +0000 |
commit | bbf3c4715a1569b26a3aa029046e26989efd6edc (patch) | |
tree | 4434cb598ad75ef600fabd3f55fc52bd7568d258 /src/qml/jsruntime/qv4qobjectwrapper.cpp | |
parent | ecb52e7991abe8d880f74f65dcdd92d7fde715d5 (diff) |
Fix crash when accessing a deleted object
In QObjectWrapper::query(), return QV4::Attr_Invalid if the object was
deleted.
Task-number: QTBUG-44153
Change-Id: I53e8be6196489c323b190dbfa20d2dda2a54315e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4qobjectwrapper.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp index 326381f38d..89c10e0995 100644 --- a/src/qml/jsruntime/qv4qobjectwrapper.cpp +++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp @@ -651,6 +651,10 @@ void QObjectWrapper::put(Managed *m, String *name, const Value &value) PropertyAttributes QObjectWrapper::query(const Managed *m, String *name) { const QObjectWrapper *that = static_cast<const QObjectWrapper*>(m); + const QObject *thatObject = that->d()->object(); + if (QQmlData::wasDeleted(thatObject)) + return QV4::Object::query(m, name); + ExecutionEngine *engine = that->engine(); QQmlContextData *qmlContext = engine->callingQmlContext(); QQmlPropertyData local; |