diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-10 19:55:07 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-08-10 19:55:07 +0000 |
commit | 8235290c734c17f5b52533876136e9a61d231c9d (patch) | |
tree | 82acae114b8e64b7b53b17b257f292f8e6b0686d /src/threadengine.cpp | |
parent | 5c4212ee9be88b05f39fc5a0fb0a8fa6366e048b (diff) |
Fix thread join not working for subclasses of Thread because of C++ destructor ordering
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11500 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/threadengine.cpp')
-rw-r--r-- | src/threadengine.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/threadengine.cpp b/src/threadengine.cpp index c6128d132..c2976c047 100644 --- a/src/threadengine.cpp +++ b/src/threadengine.cpp @@ -20,14 +20,21 @@ #include "inspircd.h" #include "threadengine.h" +void Thread::SetExitFlag() +{ + ExitFlag = true; +} + +void Thread::join() +{ + state->FreeThread(this); + delete state; + state = 0; +} + /** If this thread has a Creator set, call it to * free the thread */ Thread::~Thread() { - if (state) - { - state->FreeThread(this); - delete state; - } } |