QWinEventNotifier: Fix exit crash
Make sure the wait handle is unregistered even though there is no event dispatcher in QWinEventNotifier::setEnabled(). Task-number: QTBUG-64152 Task-number: QTCREATORBUG-19175 Change-Id: I608b95adc7cb874bc52dc5bf0e9f51b443b54ebc Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
This commit is contained in:
parent
3e5dde4766
commit
28c1e17aef
@ -199,8 +199,11 @@ void QWinEventNotifier::setEnabled(bool enable)
|
|||||||
d->enabled = enable;
|
d->enabled = enable;
|
||||||
|
|
||||||
QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.load();
|
QAbstractEventDispatcher *eventDispatcher = d->threadData->eventDispatcher.load();
|
||||||
if (!eventDispatcher) // perhaps application is shutting down
|
if (!eventDispatcher) { // perhaps application is shutting down
|
||||||
|
if (!enable && d->waitHandle != nullptr)
|
||||||
|
d->unregisterWaitObject();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (Q_UNLIKELY(thread() != QThread::currentThread())) {
|
if (Q_UNLIKELY(thread() != QThread::currentThread())) {
|
||||||
qWarning("QWinEventNotifier: Event notifiers cannot be enabled or disabled from another thread");
|
qWarning("QWinEventNotifier: Event notifiers cannot be enabled or disabled from another thread");
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user