diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 10a8473cfa..3b09d07ad2 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -1789,7 +1789,11 @@ bool Emulator::Pause() idm::select>(on_select); idm::select>(on_select); - g_fxo->get()->state += cpu_flag::dbg_global_pause; + + if (auto rsx = g_fxo->get()) + { + rsx->state += cpu_flag::dbg_global_pause; + } // Always Enable display sleep, not only if it was prevented. enable_display_sleep(); @@ -1858,7 +1862,12 @@ void Emulator::Resume() idm::select>(on_select); idm::select>(on_select); - g_fxo->get()->state -= cpu_flag::dbg_global_pause; + + if (auto rsx = g_fxo->get()) + { + // TODO: notify? + rsx->state -= cpu_flag::dbg_global_pause; + } GetCallbacks().on_resume(); @@ -1910,7 +1919,12 @@ void Emulator::Stop(bool restart) GetCallbacks().on_stop(); - g_fxo->get()->state += cpu_flag::exit; + if (auto rsx = g_fxo->get()) + { + // TODO: notify? + rsx->state += cpu_flag::exit; + } + cpu_thread::stop_all(); g_fxo->reset();