From: Christian Kandeler Date: Mon, 8 Nov 2010 17:14:09 +0000 (+0100) Subject: Maemo: Fix SFTP channel leak. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=64e47901b091fee26379626ef78f3e69ffdfbd50;p=qt-creator-jp%2Fqt-creator-jp.git Maemo: Fix SFTP channel leak. Reviewed-by: dt --- diff --git a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp index 84fdd1cb61..d6ba3dfc39 100644 --- a/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp +++ b/src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp @@ -169,18 +169,6 @@ void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus) void MaemoRemoteMounter::stop() { setState(Inactive); - if (m_utfsClientUploader) { - disconnect(m_utfsClientUploader.data(), 0, this, 0); - m_utfsClientUploader->closeChannel(); - } - if (m_mountProcess) { - disconnect(m_mountProcess.data(), 0, this, 0); - m_mountProcess->closeChannel(); - } - if (m_unmountProcess) { - disconnect(m_unmountProcess.data(), 0, this, 0); - m_unmountProcess->closeChannel(); - } } void MaemoRemoteMounter::deployUtfsClient() @@ -456,8 +444,21 @@ void MaemoRemoteMounter::assertState(const QList &expectedStates, void MaemoRemoteMounter::setState(State newState) { - if (newState == Inactive) + if (newState == Inactive) { m_utfsServerTimer->stop(); + if (m_utfsClientUploader) { + disconnect(m_utfsClientUploader.data(), 0, this, 0); + m_utfsClientUploader->closeChannel(); + } + if (m_mountProcess) { + disconnect(m_mountProcess.data(), 0, this, 0); + m_mountProcess->closeChannel(); + } + if (m_unmountProcess) { + disconnect(m_unmountProcess.data(), 0, this, 0); + m_unmountProcess->closeChannel(); + } + } m_state = newState; }