forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user