Remove process only when FailedToStart error occurred

Otherwise don't remove it yet, as many usages of QtcProcess
expect that we are still going to receive Finished signal after
an error occurred.

Change-Id: I8cae402bc2ef5064bbae964217f49028a31a73af
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2021-09-08 12:46:36 +02:00
parent d10b8e47de
commit 267a55435c

View File

@@ -144,7 +144,11 @@ void LauncherSocketHandler::handleProcessError()
packet.error = proc->error(); packet.error = proc->error();
packet.errorString = proc->errorString(); packet.errorString = proc->errorString();
sendPacket(packet); sendPacket(packet);
removeProcess(proc->token());
// In case of FailedToStart we won't receive finished signal, so we remove the process here.
// For all other errors we should expect corresponding finished signal to appear.
if (proc->error() == QProcess::FailedToStart)
removeProcess(proc->token());
} }
void LauncherSocketHandler::handleProcessStarted() void LauncherSocketHandler::handleProcessStarted()