Fix crash in Endpoint::MessageThreadProc.

This commit is contained in:
Gunnar Beutner 2013-09-11 09:44:23 +02:00
parent 6351ee8fb3
commit 551f06c744
1 changed files with 5 additions and 3 deletions

View File

@ -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)