]> granicus.if.org Git - icinga2/commitdiff
Revert Endpoint::SetClient() change.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 18 Oct 2013 10:02:35 +0000 (12:02 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 18 Oct 2013 10:02:35 +0000 (12:02 +0200)
components/cluster/endpoint.cpp
components/cluster/endpoint.h

index 6eb27635d93e91d3795672e619887e2d3f1d8996..8ba326c798c92e954b28a542c025b7016d6c08a5 100644 (file)
@@ -38,11 +38,6 @@ Endpoint::Endpoint(void)
        : m_Syncing(false)
 { }
 
-Endpoint::~Endpoint(void)
-{
-       SetClient(Stream::Ptr());
-}
-
 /**
  * Checks whether this endpoint is connected.
  *
@@ -63,12 +58,11 @@ void Endpoint::SetClient(const Stream::Ptr& client)
        if (m_Client)
                m_Client->Close();
 
-       m_Thread.join();
-
        m_Client = client;
 
        if (client) {
-               m_Thread = boost::thread(boost::bind(&Endpoint::MessageThreadProc, this, client));
+               boost::thread thread(boost::bind(&Endpoint::MessageThreadProc, this, client));
+               thread.detach();
 
                OnConnected(GetSelf());
        }
index 158df7dfba81571ddddc6239cdc65322b01f145d..04e3a7490d1e20020bd9659c5cf4bd27d80c6c21 100644 (file)
@@ -42,7 +42,6 @@ public:
        DECLARE_TYPENAME(Endpoint);
 
        Endpoint(void);
-       ~Endpoint(void);
 
        static boost::signals2::signal<void (const Endpoint::Ptr&)> OnConnected;
        static boost::signals2::signal<void (const Endpoint::Ptr&, const Dictionary::Ptr&)> OnMessageReceived;