diff --git a/Sources/Core/Thread.cpp b/Sources/Core/Thread.cpp index 536c5dd19..da8d05354 100644 --- a/Sources/Core/Thread.cpp +++ b/Sources/Core/Thread.cpp @@ -144,10 +144,13 @@ namespace spades { } void Thread::Quited() { - AutoLocker locker(&lock); + lock.Lock(); threadInfo = NULL; - if(autoDelete) + if(autoDelete) { delete this; + return; + } + lock.Unlock(); } void Thread::Run() {