Remove useless call in QProcessPrivate::waitForFinished() on Windows

if pid == nullptr, the child process has already exited and the pipe
readers have been stopped. So the call to drainOutputPipes() is
unnecessary here.

Change-Id: I0bed90d08ac879bb0ae178a1cdc37afb9d825314
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This commit is contained in:
Alex Trotsenko 2021-01-08 17:27:12 +02:00
parent db5c901594
commit 4ff41e6ff8

View File

@ -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();