Fix crash when creating threads with Thread_AutoRelease

Setting the Thread_AutoRelease flag (default when using IThreader::MakeThread) caused a use-after-free after running the thread body.
This commit is contained in:
Peace-Maker 2021-03-11 01:42:23 +01:00 committed by peace-maker
parent 99c39b1d57
commit 3c30f7b971

View File

@ -376,6 +376,7 @@ void CompatThread::Run()
// There should be no handles outstanding, so it's safe to self-destruct.
thread_->detach();
delete this;
return;
}
lock.lock();