From dc566bf1451a54d30d42784c8afe98e8e233b2eb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 18 Oct 2013 12:02:35 +0200 Subject: [PATCH] Revert Endpoint::SetClient() change. --- components/cluster/endpoint.cpp | 10 ++-------- components/cluster/endpoint.h | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/components/cluster/endpoint.cpp b/components/cluster/endpoint.cpp index 6eb27635d..8ba326c79 100644 --- a/components/cluster/endpoint.cpp +++ b/components/cluster/endpoint.cpp @@ -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()); } diff --git a/components/cluster/endpoint.h b/components/cluster/endpoint.h index 158df7dfb..04e3a7490 100644 --- a/components/cluster/endpoint.h +++ b/components/cluster/endpoint.h @@ -42,7 +42,6 @@ public: DECLARE_TYPENAME(Endpoint); Endpoint(void); - ~Endpoint(void); static boost::signals2::signal OnConnected; static boost::signals2::signal OnMessageReceived;