Skip to content
Snippets Groups Projects
Commit efb17339 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

Fix Creator crash on SSH connection loss.

QTCREATORBUG-2890

Reviewed-by: dt
parent 0a679b61
No related branches found
No related tags found
No related merge requests found
...@@ -223,9 +223,11 @@ void MaemoSshRunner::handleUnmounted() ...@@ -223,9 +223,11 @@ void MaemoSshRunner::handleUnmounted()
mount(); mount();
break; break;
case PostRunCleaning: case PostRunCleaning:
case StopRequested: case StopRequested: {
m_mounter->resetMountSpecifications(); m_mounter->resetMountSpecifications();
if (m_state == StopRequested) { const bool stopRequested = m_state == StopRequested;
setState(Inactive);
if (stopRequested) {
emit remoteProcessFinished(InvalidExitCode); emit remoteProcessFinished(InvalidExitCode);
} else if (m_exitStatus == SshRemoteProcess::ExitedNormally) { } else if (m_exitStatus == SshRemoteProcess::ExitedNormally) {
emit remoteProcessFinished(m_runner->exitCode()); emit remoteProcessFinished(m_runner->exitCode());
...@@ -233,8 +235,8 @@ void MaemoSshRunner::handleUnmounted() ...@@ -233,8 +235,8 @@ void MaemoSshRunner::handleUnmounted()
emit error(tr("Error running remote process: %1") emit error(tr("Error running remote process: %1")
.arg(m_runner->errorString())); .arg(m_runner->errorString()));
} }
setState(Inactive);
break; break;
}
default: ; default: ;
} }
} }
...@@ -338,8 +340,8 @@ void MaemoSshRunner::setState(State newState) ...@@ -338,8 +340,8 @@ void MaemoSshRunner::setState(State newState)
void MaemoSshRunner::emitError(const QString &errorMsg) void MaemoSshRunner::emitError(const QString &errorMsg)
{ {
if (m_state != Inactive) { if (m_state != Inactive) {
emit error(errorMsg);
setState(Inactive); setState(Inactive);
emit error(errorMsg);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment