summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qthread.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2011-01-27 10:49:49 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2011-01-27 13:57:43 (GMT)
commit2e72a8b19ea6c674fb4777860dac50faa5d387e6 (patch)
treee5c684f88671eee9a09a83e7374c1227d7d577ac /src/corelib/thread/qthread.cpp
parentbd6c9225328b6042ff14dfddb28e2e1279ba0e46 (diff)
downloadQt-2e72a8b19ea6c674fb4777860dac50faa5d387e6.zip
Qt-2e72a8b19ea6c674fb4777860dac50faa5d387e6.tar.gz
Qt-2e72a8b19ea6c674fb4777860dac50faa5d387e6.tar.bz2
Restore Qt 4.6 behaviour: exec() always enters the event loop.
In Qt 4.6 as well as 4.7's QCoreApplication and QEventLoop, calling exec() always enters the event loop, even if you had tried to quit()/exit() it before entering, with one exception (noted in the unit tests; this difference has been in Qt since at least Qt 4.2). Add unit tests to ensure all of the three classes have the same behaviour. Decide if we want to match the behaviours in Qt 4.8. Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/corelib/thread/qthread.cpp')
-rw-r--r--src/corelib/thread/qthread.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index f368192..f4bfa5d 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -482,10 +482,7 @@ int QThread::exec()
Q_D(QThread);
QMutexLocker locker(&d->mutex);
d->data->quitNow = false;
- if (d->exited) {
- d->exited = false;
- return d->returnCode;
- }
+ d->exited = false;
locker.unlock();
QEventLoop eventLoop;