Clang: Disconnect from server if process is a zombie

Task-number: QTCREATORBUG-19370
Change-Id: Ibf96c38004e0e0e9aa436df946076979f07df0da
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
Marco Bubke
2017-11-27 16:13:25 +01:00
parent f70bf3d2d1
commit 4007828820
2 changed files with 8 additions and 0 deletions

View File

@@ -69,6 +69,12 @@ void ConnectionClient::startProcessAndConnectToServerAsynchronously()
m_processFuture = m_processCreator.createProcess();
}
void ConnectionClient::disconnectFromServer()
{
if (m_localSocket)
m_localSocket->disconnectFromServer();
}
bool ConnectionClient::isConnected() const
{
return m_localSocket && m_localSocket->state() == QLocalSocket::ConnectedState;
@@ -164,6 +170,7 @@ void ConnectionClient::restartProcessIfTimerIsNotResettedAndSocketIsEmpty()
if (!m_localSocket || m_localSocket->bytesAvailable() > 0)
return; // We come first, the incoming data was not yet processed.
disconnectFromServer();
restartProcessAsynchronously();
}

View File

@@ -58,6 +58,7 @@ public:
virtual ~ConnectionClient();
void startProcessAndConnectToServerAsynchronously();
void disconnectFromServer();
bool isConnected() const;
void sendEndMessage();