From 948263bf4bdfec1383f22fc0db50bafca2f8b5c8 Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Thu, 8 Apr 2010 14:01:18 +1000 Subject: Correctly handle shutdown order in the presence of QWidgets The QWidget destructor is largely a copy of the QObject destructor. QML shutdown occurs in a slightly different order in this case. --- src/declarative/qml/qdeclarativecontext_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/declarative/qml/qdeclarativecontext_p.h b/src/declarative/qml/qdeclarativecontext_p.h index 6c5a1f7..eee72b6 100644 --- a/src/declarative/qml/qdeclarativecontext_p.h +++ b/src/declarative/qml/qdeclarativecontext_p.h @@ -174,7 +174,7 @@ public: inline ContextGuard &operator=(QObject *obj) { QDeclarativeGuard::operator=(obj); return *this; } virtual void objectDestroyed(QObject *) { - if (!QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify(); + if (context->contextObject && !QObjectPrivate::get(context->contextObject)->wasDeleted) bindings.notify(); } QDeclarativeContextData *context; QDeclarativeNotifier bindings; -- cgit v0.12