threading_posix: don't delete thread_local thread object

Disabling on exit thread delete as it causes an assert fail.
There isn't a leak here because current_thread_ is a thread_local static.
This commit is contained in:
Sandy Carter 2020-11-21 22:36:20 -05:00 committed by Rick Gibbed
parent aa332dcc8e
commit 5fa59fc4a9
1 changed files with 4 additions and 1 deletions

View File

@ -1007,7 +1007,10 @@ Thread* Thread::GetCurrentThread() {
pthread_t handle = pthread_self(); pthread_t handle = pthread_self();
current_thread_ = new PosixThread(handle); current_thread_ = new PosixThread(handle);
atexit([] { delete current_thread_; }); // TODO(bwrsandman): Disabling deleting thread_local current thread to prevent
// assert in destructor. Since this is thread local, the
// "memory leaking" is controlled.
// atexit([] { delete current_thread_; });
return current_thread_; return current_thread_;
} }