From c6ab1aa2270453f6ce9e281f544221668f17e173 Mon Sep 17 00:00:00 2001 From: Elad Ashkenazi Date: Wed, 5 Apr 2023 22:53:01 +0300 Subject: [PATCH] Fix emulator crash when stopping emulation after being paused (#13530) --- rpcs3/Emu/System.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 338f23ef69..1da9c27549 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -2498,7 +2498,13 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta for (u32 i = 100; i < 140; i++) { std::this_thread::sleep_for(50ms); - Resume(); // TODO: Prevent pausing by other threads while in this loop + + // TODO: Prevent pausing by other threads while in this loop + CallFromMainThread([this]() + { + Resume(); + }, nullptr, true, read_counter); + process_qt_events(); // Is nullified when performed on non-main thread if (!read_sysutil_signal && read_counter != get_sysutil_cb_manager_read_count())