summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-11-14 20:03:07 +0100
committerGitHub <noreply@github.com>2026-11-14 20:03:07 +0100
commitbe0e304c02341d676cfbbf0cefacb965d2b5be79 (patch)
treec3401c36b1db432d36a2e7b4bd007dc2e00a843f
parent761713cec9ce883d9ef8ea9a2cf65b6f09e79932 (diff)
parent0436c9f60eb1e815a65f01d5edb6a5a155911553 (diff)
Merge pull request #14978 from JoshuaVandaele/quick-stop-hang
CPU: Fix quickly-stopped games hanging Dolphin
-rw-r--r--Source/Core/Core/HW/CPU.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/Core/HW/CPU.cpp b/Source/Core/Core/HW/CPU.cpp
index abd632d66c..5f4890f04e 100644
--- a/Source/Core/Core/HW/CPU.cpp
+++ b/Source/Core/Core/HW/CPU.cpp
@@ -32,7 +32,11 @@ CPUManager::~CPUManager() = default;
void CPUManager::Init(PowerPC::CPUCore cpu_core)
{
m_system.GetPowerPC().Init(cpu_core);
- m_state = State::Stepping;
+
+ std::lock_guard state_lock(m_state_change_lock);
+ // A stop may have been requested while the core was booting, in which case don't overwrite it.
+ if (Core::GetState(m_system) != Core::State::Stopping)
+ m_state = State::Stepping;
}
void CPUManager::Shutdown()