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 <orgads@gmail.com>
This commit is contained in:
Jarek Kobus
2024-01-20 20:30:47 +01:00
parent 767e11aa5d
commit c86a19a56e

View File

@@ -1876,6 +1876,8 @@ void Process::runBlocking(EventLoopMode eventLoopMode)
if (d->m_timeoutInSeconds > 0) { if (d->m_timeoutInSeconds > 0) {
timeoutHandler = [this, &eventLoop, &timeoutHandler] { timeoutHandler = [this, &eventLoop, &timeoutHandler] {
if (!d->m_timeOutMessageBoxEnabled || askToKill(d->m_setup.m_commandLine)) { if (!d->m_timeOutMessageBoxEnabled || askToKill(d->m_setup.m_commandLine)) {
if (state() == QProcess::NotRunning)
return;
stop(); stop();
waitForFinished(); waitForFinished();
d->m_result = ProcessResult::Hang; d->m_result = ProcessResult::Hang;