From 7366d0fcff70c6b9600ba9d599182f125fc8afad Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 4 Jul 2021 00:27:23 +1000 Subject: [PATCH] FullscreenUI: Fix start file running inside UI call --- src/frontend-common/fullscreen_ui.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/frontend-common/fullscreen_ui.cpp b/src/frontend-common/fullscreen_ui.cpp index 8d1b0c9e0..be3109f69 100644 --- a/src/frontend-common/fullscreen_ui.cpp +++ b/src/frontend-common/fullscreen_ui.cpp @@ -596,11 +596,13 @@ static void DoStartPath(const std::string& path, bool allow_resume) if (allow_resume && g_settings.save_state_on_exit) { - s_host_interface->ResumeSystemFromState(path.c_str(), true); - return; + s_host_interface->RunLater([path]() { s_host_interface->ResumeSystemFromState(path.c_str(), true); }); + } + else + { + auto params = std::make_shared(path); + s_host_interface->RunLater([params]() { s_host_interface->BootSystem(std::move(params)); }); } - - s_host_interface->BootSystem(std::make_shared(path)); } static void DoStartFile()