From c86a19a56e6dc40c46b34a2634d711516fb5a3ee Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Sat, 20 Jan 2024 20:30:47 +0100 Subject: [PATCH] Process: Fix stopping the process while message box is visible When process finished while the message box querying for a process to be stopped after a timeout was visible, don't try to stop it and don't report a hang. Change-Id: I74a819244a96d9e0209cabc6d58c0a1c4fe1ac31 Reviewed-by: Orgad Shaneh --- src/libs/utils/process.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/utils/process.cpp b/src/libs/utils/process.cpp index 7dc27f908ec..90bc0c4045d 100644 --- a/src/libs/utils/process.cpp +++ b/src/libs/utils/process.cpp @@ -1876,6 +1876,8 @@ void Process::runBlocking(EventLoopMode eventLoopMode) if (d->m_timeoutInSeconds > 0) { timeoutHandler = [this, &eventLoop, &timeoutHandler] { if (!d->m_timeOutMessageBoxEnabled || askToKill(d->m_setup.m_commandLine)) { + if (state() == QProcess::NotRunning) + return; stop(); waitForFinished(); d->m_result = ProcessResult::Hang;