aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 10:30:20 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-12-24 10:30:20 +0100
commitd588ec795bf905d6d4a4827ad74f3d01315e40bf (patch)
tree67227f80379d77962602b758093251b593ee0c08 /src/qml/qml
parent13e88fe2b9b1680cb161a249289c3ba998f08c0c (diff)
parentfdc18a5f25ba1c4cf35e1fa6f21272167bde36a9 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/quick/items/qquickrectangle.cpp Change-Id: Ia40bc0f2f08b5be68e32eb1e1f118445d20e44fc
Diffstat (limited to 'src/qml/qml')
-rw-r--r--src/qml/qml/ftw/qqmlthread.cpp41
1 files changed, 27 insertions, 14 deletions
diff --git a/src/qml/qml/ftw/qqmlthread.cpp b/src/qml/qml/ftw/qqmlthread.cpp
index 3accb9dce5..1ea3f25405 100644
--- a/src/qml/qml/ftw/qqmlthread.cpp
+++ b/src/qml/qml/ftw/qqmlthread.cpp
@@ -179,15 +179,17 @@ void QQmlThreadPrivate::threadEvent()
{
lock();
- if (m_shutdown) {
- quit();
- wakeOne();
- unlock();
- q->shutdownThread();
- } else {
- m_threadProcessing = true;
+ for (;;) {
+ if (m_shutdown) {
+ quit();
+ wakeOne();
+ unlock();
+ q->shutdownThread();
+
+ return;
+ } else if (!threadList.isEmpty()) {
+ m_threadProcessing = true;
- while (!threadList.isEmpty()) {
QQmlThread::Message *message = threadList.first();
unlock();
@@ -197,13 +199,15 @@ void QQmlThreadPrivate::threadEvent()
lock();
delete threadList.takeFirst();
- }
+ } else {
+ wakeOne();
- wakeOne();
+ m_threadProcessing = false;
- m_threadProcessing = false;
+ unlock();
- unlock();
+ return;
+ }
}
}
@@ -228,8 +232,11 @@ void QQmlThread::shutdown()
d->lock();
Q_ASSERT(!d->m_shutdown);
d->m_shutdown = true;
- if (d->threadList.isEmpty() && d->m_threadProcessing == false)
+ if (d->threadList.isEmpty() && d->m_threadProcessing == false) {
d->triggerThreadEvent();
+ } else if (d->mainSync) {
+ d->wakeOne();
+ }
d->wait();
d->unlock();
d->QThread::wait();
@@ -333,8 +340,14 @@ void QQmlThread::internalCallMethodInMain(Message *message)
d->triggerMainEvent();
}
- while (d->mainSync && !d->m_shutdown)
+ while (d->mainSync) {
+ if (d->m_shutdown) {
+ delete d->mainSync;
+ d->mainSync = 0;
+ break;
+ }
d->wait();
+ }
d->unlock();
}