diff --git a/rpcs3/Emu/CPU/CPUThread.cpp b/rpcs3/Emu/CPU/CPUThread.cpp index c3393a61ac..0567e367a6 100644 --- a/rpcs3/Emu/CPU/CPUThread.cpp +++ b/rpcs3/Emu/CPU/CPUThread.cpp @@ -329,11 +329,17 @@ namespace cpu_counter void remove(cpu_thread* _this) noexcept { + // Return if not registered + const u32 slot = s_tls_thread_slot; + + if (slot == umax) + { + return; + } + // Unregister and wait if necessary verify(HERE), _this->state & cpu_flag::wait; - u32 slot = s_tls_thread_slot; - if (slot >= std::size(s_cpu_list)) { sys_log.fatal("Index out of bounds (%u)." HERE, slot);