Process: Don't call waitForFinished() when process is not running

Fixes: QTCREATORBUG-30537
Change-Id: I8594fd6982e22044a43e5a67411b50f1bdc02426
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Jarek Kobus
2024-03-14 09:38:10 +01:00
parent d5c357e67b
commit 11752615c5

View File

@@ -1934,7 +1934,7 @@ void Process::runBlocking(seconds timeout, EventLoopMode eventLoopMode)
#endif #endif
} else { } else {
handleStart(); handleStart();
if (!waitForFinished(timeout)) if (state() != QProcess::NotRunning && !waitForFinished(timeout))
handleTimeout(); handleTimeout();
} }
if (blockingThresholdMs > 0) { if (blockingThresholdMs > 0) {