Initialized member mTid of class bdThread.

RetroShare crashes on start, when the initial address on port 7812 is in use.
The thread in UdpLayer::openSocket was not started and the member mTid was uninitialized.
Then a call to join in UdpLayer::reset during the load of the configuration crashes.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@3337 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2010-08-03 14:07:46 +00:00
parent cfd4eaad37
commit e71b1c249f

View File

@ -65,7 +65,14 @@ pthread_t createThread(bdThread &thread);
class bdThread
{
public:
bdThread() { return; }
bdThread()
{
#if defined(_WIN32) || defined(__MINGW32__)
memset (&mTid, 0, sizeof(mTid));
#else
mTid = 0;
#endif
}
virtual ~bdThread() { return; }
virtual void start() { createThread(*this); }