From 5fa59fc4a9688f6676738966f9b67b928021a5c6 Mon Sep 17 00:00:00 2001 From: Sandy Carter Date: Sat, 21 Nov 2020 22:36:20 -0500 Subject: [PATCH] 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. --- src/xenia/base/threading_posix.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/xenia/base/threading_posix.cc b/src/xenia/base/threading_posix.cc index f6a6db193..7194855f2 100644 --- a/src/xenia/base/threading_posix.cc +++ b/src/xenia/base/threading_posix.cc @@ -1007,7 +1007,10 @@ Thread* Thread::GetCurrentThread() { pthread_t handle = pthread_self(); 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_; }