diff --git a/rpcs3/Emu/Cell/lv2/sys_spu.cpp b/rpcs3/Emu/Cell/lv2/sys_spu.cpp index 7e705d4911..fa3babd8ca 100644 --- a/rpcs3/Emu/Cell/lv2/sys_spu.cpp +++ b/rpcs3/Emu/Cell/lv2/sys_spu.cpp @@ -1989,7 +1989,7 @@ error_code raw_spu_destroy(ppu_thread& ppu, u32 id) (*thread)(); - if (idm::withdraw>(idm_id, [&](spu_thread& spu) -> CellError + if (auto ret = idm::withdraw>(idm_id, [&](spu_thread& spu) -> CellError { if (std::addressof(spu) != std::addressof(*thread)) { @@ -1998,7 +1998,7 @@ error_code raw_spu_destroy(ppu_thread& ppu, u32 id) spu.cleanup(); return {}; - }).ret) + }); !ret || ret.ret) { // Other thread destroyed beforehead return CELL_ESRCH;