]> granicus.if.org Git - icinga2/commitdiff
Make sure that the timeout timer gets destroyed properly
authorGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 18:54:41 +0000 (19:54 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 27 Feb 2015 18:54:41 +0000 (19:54 +0100)
refs #8554

lib/remote/apiclient.cpp

index 69dee98bdda932ef6f43818db4b20b378d222455..2fcf1663119e34f2be9bf1386b9bcb38dfd2c8e0 100644 (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)