SshDeviceProcess: don't connect to stubStopped, it's no-op

After 479c393009 the connection
to ConsoleProcess::stubStopped() became no-op, since
when finished() signal is emitted we are disconnecting
from console process signals inside setState(). In case
when the socket of console process got disconnected while
the process was still running, we are emitting finished()
signal prior to stubStopped() (when m_appPid != 0 or
m_hInferior != nullptr, otherwise it had to be emitted earlier),
so the stubStopped is also no-op in this case.

Amends 479c393009

Change-Id: I75189b9476281413c8a206de78b9008f9ee08a25
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Jarek Kobus
2022-01-20 09:48:54 +01:00
parent ead181e385
commit c819c90368
2 changed files with 1 additions and 4 deletions

View File

@@ -862,9 +862,8 @@ void ConsoleProcess::stubExited()
d->m_stubPid = 0;
delete d->m_tempFile;
d->m_tempFile = nullptr;
if (d->m_appPid) {
if (d->m_appPid)
finish(-1, QProcess::CrashExit);
}
#endif
emit stubStopped();
}

View File

@@ -199,8 +199,6 @@ void SshDeviceProcess::handleConnected()
this, &SshDeviceProcess::handleProcessStarted);
connect(&d->consoleProcess, &ConsoleProcess::finished,
this, [this] { handleProcessFinished(d->consoleProcess.errorString()); });
connect(&d->consoleProcess, &ConsoleProcess::stubStopped,
this, [this] { handleProcessFinished(d->consoleProcess.errorString()); });
d->consoleProcess.setAbortOnMetaChars(false);
d->consoleProcess.setSettings(Core::ICore::settings());
d->consoleProcess.setCommand(d->process->fullLocalCommandLine());