From 551f06c744fea5b94211c0a61cdc69ef4d7a44c6 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 11 Sep 2013 09:44:23 +0200 Subject: [PATCH] Fix crash in Endpoint::MessageThreadProc. --- components/cluster/endpoint.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/cluster/endpoint.cpp b/components/cluster/endpoint.cpp index e9ab41e55..efb08e847 100644 --- a/components/cluster/endpoint.cpp +++ b/components/cluster/endpoint.cpp @@ -59,10 +59,12 @@ void Endpoint::SetClient(const Stream::Ptr& client) m_Client = client; } - boost::thread thread(boost::bind(&Endpoint::MessageThreadProc, this, client)); - thread.detach(); + if (client) { + boost::thread thread(boost::bind(&Endpoint::MessageThreadProc, this, client)); + thread.detach(); - OnConnected(GetSelf()); + OnConnected(GetSelf()); + } } void Endpoint::SendMessage(const Dictionary::Ptr& message) -- 2.40.0