summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2011-03-03 13:33:04 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2011-03-03 13:57:00 (GMT)
commit25723504d1fc917671dbdeadf441c2ca12145297 (patch)
tree44ef12570b24a9eaac1a8fff21a6c66b765b487b
parent65dac2b78c38803f418b331015c801247321dd1b (diff)
downloadQt-25723504d1fc917671dbdeadf441c2ca12145297.zip
Qt-25723504d1fc917671dbdeadf441c2ca12145297.tar.gz
Qt-25723504d1fc917671dbdeadf441c2ca12145297.tar.bz2
Fix QProcess::waitForFinished WaitForRequest handling in Symbian
Waiting for both logonStatus and timerStatus after one has already completed normally could potentially return because some unrelated request completed in the meantime, swallowing the wrong signal. Task-number: QT-4659 Reviewed-by: Janne Koskinen
-rw-r--r--src/corelib/io/qprocess_symbian.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/corelib/io/qprocess_symbian.cpp b/src/corelib/io/qprocess_symbian.cpp
index d22d1ed..8a74c7b 100644
--- a/src/corelib/io/qprocess_symbian.cpp
+++ b/src/corelib/io/qprocess_symbian.cpp
@@ -961,16 +961,15 @@ bool QProcessPrivate::waitForFinished(int msecs)
User::WaitForRequest(logonStatus, timerStatus);
QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished() - Wait completed");
- if (timerStatus == KErrNone)
+ if (logonStatus != KRequestPending) {
+ timer.Cancel();
+ User::WaitForRequest(timerStatus);
+ } else {
timeoutOccurred = true;
-
- timer.Cancel();
+ symbianProcess->LogonCancel(logonStatus);
+ User::WaitForRequest(logonStatus);
+ }
timer.Close();
-
- symbianProcess->LogonCancel(logonStatus);
-
- // Eat cancel request completion so that it won't mess up main thread scheduling later
- User::WaitForRequest(logonStatus, timerStatus);
}
} else {
QPROCESS_DEBUG_PRINT("QProcessPrivate::waitForFinished(), qt_rprocess_running returned false");