From b16604210ce33a6c4f47c68ddf13a10019f7bc12 Mon Sep 17 00:00:00 2001 From: yvt Date: Thu, 2 Jan 2014 03:28:06 +0900 Subject: [PATCH] Addressed a problem that causes random crashes --- Sources/Core/Thread.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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() {