From 11752615c5db419bd4bf9842b4f0ba1f8aca8051 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Thu, 14 Mar 2024 09:38:10 +0100 Subject: [PATCH] Process: Don't call waitForFinished() when process is not running Fixes: QTCREATORBUG-30537 Change-Id: I8594fd6982e22044a43e5a67411b50f1bdc02426 Reviewed-by: Marcus Tillmanns --- src/libs/utils/process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 111ebe89cf6..802ae632f1a 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1934,7 +1934,7 @@ void Process::runBlocking(seconds timeout, EventLoopMode eventLoopMode) #endif } else { handleStart(); - if (!waitForFinished(timeout)) + if (state() != QProcess::NotRunning && !waitForFinished(timeout)) handleTimeout(); } if (blockingThresholdMs > 0) {