Skip to content

Commit

Permalink
Addressed a problem that causes random crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
yvt committed Jan 1, 2014
1 parent c272ff7 commit b166042
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/Core/Thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit b166042

Please sign in to comment.