diff options
| author | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-03-15 14:41:28 +0100 |
|---|---|---|
| committer | Jarek Kobus <jaroslaw.kobus@qt.io> | 2022-03-18 15:19:35 +0000 |
| commit | dabe2e1493131114e6d71cb6f14b11957eea3b5b (patch) | |
| tree | 213431543f0ed8b1e5bd7a802132840f1612244b /src/tools/processlauncher | |
| parent | b6f679d77736134dfdfd09403d494448f83eb99c (diff) | |
| download | qt-creator-dabe2e1493131114e6d71cb6f14b11957eea3b5b.tar.gz | |
ProcessLauncher: Don't emit error twice on process crash
Behave the same as QProcess in this circumstances.
Change-Id: If8175ccb7102d6a561584ee73c2e5c5844f2770d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/tools/processlauncher')
| -rw-r--r-- | src/tools/processlauncher/launchersockethandler.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/tools/processlauncher/launchersockethandler.cpp b/src/tools/processlauncher/launchersockethandler.cpp index 952d6516f2..e3468aa53e 100644 --- a/src/tools/processlauncher/launchersockethandler.cpp +++ b/src/tools/processlauncher/launchersockethandler.cpp @@ -136,15 +136,19 @@ void LauncherSocketHandler::handleSocketClosed() void LauncherSocketHandler::handleProcessError() { Process * proc = senderProcess(); + + // In case of FailedToStart we won't receive finished signal, so we send the error + // packet and remove the process here and now. For all other errors we should expect + // corresponding finished signal to appear, so we will send the error data together with + // the finished packet later on. + if (proc->error() != QProcess::FailedToStart) + return; + ProcessErrorPacket packet(proc->token()); packet.error = proc->error(); packet.errorString = proc->errorString(); sendPacket(packet); - - // 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()); + removeProcess(proc->token()); } void LauncherSocketHandler::handleProcessStarted() |
