aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDyami Caliri <dyami@dragonframe.com>2014-09-21 12:30:24 -0700
committerSimon Hausmann <simon.hausmann@digia.com>2014-09-22 13:28:35 +0200
commit51a2bd8dfa15f52e2b45b3a0cc0135603a374200 (patch)
tree178fdeb9c34affa59795cabc1260dc4284100fb3 /src
parenta5cb3ca5c058903bcf68fb24d3fdcf1eecb1e5a8 (diff)
Fix deadlock with QQuickView embedded via QWidget::createWindowContainer
A QQuickView embedded in a widget application will be deleted in the QApplication destructor. At that point, events are not being posted, so the QQmlThread cannot properly shut down, and will deadlock waiting for an event. Task-number: QTBUG-36115 Change-Id: I4595f03e0afcf9463cfbc2ba95146d4777d19c56 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index 18b257dc0e..b3d7bddff7 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -139,6 +139,7 @@ void QQmlThreadPrivate::run()
q->startupThread();
exec();
+ q->shutdownThread();
}
void QQmlThreadPrivate::mainEvent()
@@ -177,7 +178,6 @@ void QQmlThreadPrivate::threadEvent()
quit();
wakeOne();
unlock();
- q->shutdownThread();
return;
} else if (!threadList.isEmpty()) {
@@ -229,7 +229,14 @@ void QQmlThread::shutdown()
Q_ASSERT(!d->m_shutdown);
d->m_shutdown = true;
if (d->threadList.isEmpty() && d->m_threadProcessing == false) {
- d->triggerThreadEvent();
+ if (QCoreApplication::closingDown()) {
+ d->quit();
+ d->unlock();
+ d->QThread::wait();
+ return;
+ } else {
+ d->triggerThreadEvent();
+ }
} else if (d->mainSync) {
d->wakeOne();
}