forked from qt-creator/qt-creator
Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at the time of the call. Handle that throughout the codebase. Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094 Reviewed-by: hjk <hjk@theqtcompany.com>
This commit is contained in:
@@ -463,7 +463,7 @@ void ProcessExtraCompiler::runInThread(
|
||||
if (!isCanceled) {
|
||||
handleProcessStarted(&process, sourceContents);
|
||||
forever {
|
||||
bool done = process.waitForFinished(200);
|
||||
bool done = process.waitForFinished(200) || process.state() == QProcess::NotRunning;
|
||||
isCanceled = futureInterface.isCanceled();
|
||||
if (done || isCanceled)
|
||||
break;
|
||||
@@ -473,7 +473,7 @@ void ProcessExtraCompiler::runInThread(
|
||||
isCanceled |= process.state() == QProcess::Running;
|
||||
if (isCanceled) {
|
||||
process.kill();
|
||||
process.waitForFinished(3000);
|
||||
process.waitForFinished();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user