From e71b1c249ffe171b8f804c28edea859fae091d4b Mon Sep 17 00:00:00 2001 From: thunder2 Date: Tue, 3 Aug 2010 14:07:46 +0000 Subject: [PATCH] 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 --- libbitdht/src/util/bdthreads.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libbitdht/src/util/bdthreads.h b/libbitdht/src/util/bdthreads.h index f6be517e4..ea4a2435f 100644 --- a/libbitdht/src/util/bdthreads.h +++ b/libbitdht/src/util/bdthreads.h @@ -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); }