[icinga-checkins] icinga.org: icinga2/master: Make sure that the timeout timer gets destroyed properly

git at icinga.org git at icinga.org
Fri Feb 27 19:55:11 CET 2015


Module: icinga2
Branch: master
Commit: d7000fa7572d6c4a46603160553b124817c1d726
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=d7000fa7572d6c4a46603160553b124817c1d726

Author: Gunnar Beutner <gunnar at beutner.name>
Date:   Fri Feb 27 19:54:41 2015 +0100

Make sure that the timeout timer gets destroyed properly

refs #8554

---

 lib/remote/apiclient.cpp |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/remote/apiclient.cpp b/lib/remote/apiclient.cpp
index 69dee98..2fcf166 100644
--- a/lib/remote/apiclient.cpp
+++ b/lib/remote/apiclient.cpp
@@ -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)



More information about the icinga-checkins mailing list