diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 2a5b8fd4fd5..e65d4683be8 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -776,10 +776,8 @@ bool QProcessPrivate::waitForFinished(const QDeadlineTimer &deadline) if (stderrChannel.reader && stderrChannel.reader->waitForReadyRead(0)) timer.resetIncrements(); - if (!pid) { - drainOutputPipes(); + if (!pid) return true; - } if (WaitForSingleObject(pid->hProcess, timer.nextSleepTime()) == WAIT_OBJECT_0) { drainOutputPipes();