OSDN Git Service

Maemo: Fix possible crash on stopping a run control.
authorChristian Kandeler <christian.kandeler@nokia.com>
Wed, 15 Dec 2010 16:50:06 +0000 (17:50 +0100)
committercon <qtc-committer@nokia.com>
Tue, 4 Jan 2011 16:51:52 +0000 (17:51 +0100)
The crash happens when the run control is stopped before a connection
has been established.

Task-number: QTCREATORBUG-3374
Reviewed-by: Tobias Hunger
src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp

index db29a62..1b2f67c 100644 (file)
@@ -108,6 +108,11 @@ void MaemoSshRunner::stop()
     if (m_state == PostRunCleaning || m_state == StopRequested
         || m_state == Inactive)
         return;
+    if (m_state == Connecting) {
+        setState(Inactive);
+        emit remoteProcessFinished(InvalidExitCode);
+        return;
+    }
 
     setState(StopRequested);
     cleanup();