summaryrefslogtreecommitdiff
path: root/src/libs/ssh/sshremoteprocessrunner.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-04-04 14:31:21 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-04-05 12:41:26 +0000
commit4093fbe8266ce09dac9948b252724043dcc1905d (patch)
tree521d4037421efb78f6598c915bd1cec016f96fae /src/libs/ssh/sshremoteprocessrunner.cpp
parenta717ff71f452994741a86cbb391538e3d2bbf386 (diff)
downloadqt-creator-4093fbe8266ce09dac9948b252724043dcc1905d.tar.gz
Don't delete process directly from process' finished handler
AbstractProcessStep::slotProcessFinished() slot is connected to m_process finished() signal. We call there AbstractProcessStep::Private::cleanUp(), and that calls m_process.reset(), so it invokes m_process d'tor directly. SshRemoteProcessRunner::handleProcessFinished() slot is connected to d->m_process finished() signal. We call there SshRemoteProcessRunner::setState(), and that calls d->m_process.reset(), so it invokes m_process d'tor directly. Delete later m_process instead in both cases. Change-Id: I4a0f2a631b676b57e8bcc3a7878620bc76dc74de Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/ssh/sshremoteprocessrunner.cpp')
-rw-r--r--src/libs/ssh/sshremoteprocessrunner.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/ssh/sshremoteprocessrunner.cpp b/src/libs/ssh/sshremoteprocessrunner.cpp
index 617ffc000c..0bf337917b 100644
--- a/src/libs/ssh/sshremoteprocessrunner.cpp
+++ b/src/libs/ssh/sshremoteprocessrunner.cpp
@@ -161,7 +161,7 @@ void SshRemoteProcessRunner::setState(int newState)
d->m_state = static_cast<State>(newState);
if (d->m_state == Inactive) {
if (d->m_process)
- d->m_process.reset();
+ d->m_process.release()->deleteLater();
if (d->m_connection) {
disconnect(d->m_connection, nullptr, this, nullptr);
SshConnectionManager::releaseConnection(d->m_connection);