Make sure that the timeout timer gets destroyed properly

refs #8554
This commit is contained in:
Gunnar Beutner 2015-02-27 19:54:41 +01:00
parent 9622b075bc
commit d7000fa757
1 changed files with 4 additions and 5 deletions

View File

@ -103,6 +103,9 @@ void ApiClient::SendMessageSync(const Dictionary::Ptr& message)
void ApiClient::Disconnect(void)
{
m_TimeoutTimer->Stop();
m_TimeoutTimer.reset();
Log(LogWarning, "ApiClient")
<< "API client disconnected for identity '" << m_Identity << "'";
@ -113,11 +116,7 @@ void ApiClient::Disconnect(void)
listener->RemoveAnonymousClient(this);
}
try {
m_Stream->Close();
} catch (const std::exception&) {
/* Ignore the exception. */
}
m_Stream->Close();
}
bool ApiClient::ProcessMessage(void)