Fix emulator crash when stopping emulation after being paused (#13530)
This commit is contained in:
@@ -2498,7 +2498,13 @@ void Emulator::GracefulShutdown(bool allow_autoexit, bool async_op, bool savesta
|
|||||||
for (u32 i = 100; i < 140; i++)
|
for (u32 i = 100; i < 140; i++)
|
||||||
{
|
{
|
||||||
std::this_thread::sleep_for(50ms);
|
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
|
process_qt_events(); // Is nullified when performed on non-main thread
|
||||||
|
|
||||||
if (!read_sysutil_signal && read_counter != get_sysutil_cb_manager_read_count())
|
if (!read_sysutil_signal && read_counter != get_sysutil_cb_manager_read_count())
|
||||||
|
|||||||
Reference in New Issue
Block a user