From 6bd96a4590aa2050cc53eff0867d6426a9d82732 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Tue, 10 Mar 2020 23:23:32 +0300 Subject: [PATCH] Fix thread_base::finalize (and emergency_exit, collaterally) Forgot to reset futex callback. Could cause crashes. --- Utilities/Thread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 8d840f8ce9..a0efec6ead 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1912,6 +1912,7 @@ bool thread_base::finalize(int) noexcept void thread_base::finalize() noexcept { + atomic_storage_futex::set_wait_callback([](const void*){ return true; }); g_tls_log_prefix = []() -> std::string { return {}; }; thread_ctrl::g_tls_this_thread = nullptr; } @@ -2091,7 +2092,6 @@ void thread_ctrl::emergency_exit(std::string_view reason) delete _this; } - // Do some not very useful cleanup thread_base::finalize(); #ifdef _WIN32