CPUThread: fix ASAN use-after-free

This commit is contained in:
oltolm 2026-04-05 19:06:01 +02:00 committed by Elad
parent e9fb3572f9
commit a1a140db91

View File

@ -729,8 +729,14 @@ void cpu_thread::operator()()
{
if (_this)
{
sys_log.warning("CPU Thread '%s' terminated abnormally!", name);
cleanup();
auto log_thread = named_thread("CPU Thread Cleanup Logger", [name = name]()
{
sys_log.warning("CPU Thread '%s' terminated abnormally!", name);
});
log_thread();
}
}
} cleanup;