summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qwineventnotifier.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-21 01:00:08 +0200
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-10-21 01:00:09 +0200
commit7a252ac46780b6145084d8d5ca0549b2de3639cc (patch)
treee8a938a26fb610e0eaba62dcf185b2e361f01951 /src/corelib/kernel/qwineventnotifier.cpp
parent10b8ed816d0dff4321d5a8b0723a8090b2058678 (diff)
parent2708c6c11d685ab25c12d558961d924c9a4533d2 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
Diffstat (limited to 'src/corelib/kernel/qwineventnotifier.cpp')
-rw-r--r--src/corelib/kernel/qwineventnotifier.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp
index 85d4ad4fa9..3c73c0b851 100644
--- a/src/corelib/kernel/qwineventnotifier.cpp
+++ b/src/corelib/kernel/qwineventnotifier.cpp
@@ -257,6 +257,14 @@ static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/)
{
QWinEventNotifierPrivate *nd = reinterpret_cast<QWinEventNotifierPrivate *>(context);
QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.load();
+
+ // Happens when Q(Core)Application is destroyed before QWinEventNotifier.
+ // https://bugreports.qt.io/browse/QTBUG-70214
+ if (!eventDispatcher) { // perhaps application is shutting down
+ qWarning("QWinEventNotifier: no event dispatcher, application shutting down? Cannot deliver event.");
+ return;
+ }
+
QEventDispatcherWin32Private *edp = QEventDispatcherWin32Private::get(
static_cast<QEventDispatcherWin32 *>(eventDispatcher));
++nd->signaledCount;