From e507fdcb1f749b31a5e69e344c90fe3b18b559d5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 11 Dec 2024 17:55:53 +1000 Subject: [PATCH] System: Load state before calling OnSystemStarted() Needed for transitent state cleanup on Android. --- src/core/system.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/system.cpp b/src/core/system.cpp index 2e1123ebe..d2bc4db08 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1863,6 +1863,15 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error) s_state.state = State::Running; SPU::GetOutputStream()->SetPaused(false); + // try to load the state, if it fails, bail out + if (!parameters.save_state.empty() && !LoadState(parameters.save_state.c_str(), error, false)) + { + Error::AddPrefixFmt(error, "Failed to load save state file '{}' for booting:\n", + Path::GetFileName(parameters.save_state)); + DestroySystem(); + return false; + } + FullscreenUI::OnSystemStarted(); InputManager::UpdateHostMouseMode(); @@ -1878,15 +1887,6 @@ bool System::BootSystem(SystemBootParameters parameters, Error* error) Host::OnSystemStarted(); Host::OnIdleStateChanged(); - // try to load the state, if it fails, bail out - if (!parameters.save_state.empty() && !LoadState(parameters.save_state.c_str(), error, false)) - { - Error::AddPrefixFmt(error, "Failed to load save state file '{}' for booting:\n", - Path::GetFileName(parameters.save_state)); - DestroySystem(); - return false; - } - if (parameters.load_image_to_ram || g_settings.cdrom_load_image_to_ram) CDROM::PrecacheMedia();