aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/qqmlengine.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index 5efebe28a2..d99bec4c52 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -891,6 +891,8 @@ void QQmlData::setQueuedForDeletion(QObject *object)
if (ddata->ownContext) {
Q_ASSERT(ddata->ownContext == ddata->context);
ddata->context->emitDestruction();
+ if (ddata->ownContext->contextObject == object)
+ ddata->ownContext->contextObject = nullptr;
ddata->ownContext = 0;
ddata->context = 0;
}