From c492a5a86a46a2950a4833ccfa3e862452253679 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 5 Jan 2018 14:08:09 +0100 Subject: [PATCH] Don't involve host thread when booting from savestate Suggested by https://github.com/dolphin-emu/dolphin/pull/6271#discussion_r159868704 --- Source/Core/Core/Core.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index 500885ffbb..5f740c489f 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -341,15 +341,6 @@ static void CpuThread(const std::optional& savestate_path, bool del if (_CoreParameter.bFastmem) EMM::InstallExceptionHandler(); // Let's run under memory watch - if (savestate_path) - { - QueueHostJob([&savestate_path, delete_savestate] { - ::State::LoadAs(*savestate_path); - if (delete_savestate) - File::Delete(*savestate_path); - }); - } - s_is_started = true; CPUSetInitialExecutionState(); @@ -374,6 +365,13 @@ static void CpuThread(const std::optional& savestate_path, bool del MemoryWatcher::Init(); #endif + if (savestate_path) + { + ::State::LoadAs(*savestate_path); + if (delete_savestate) + File::Delete(*savestate_path); + } + // Enter CPU run loop. When we leave it - we are done. CPU::Run();