From e6684d17c159c20b9754b19f2cc22222584f50c3 Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Fri, 23 May 2014 09:45:14 -0400 Subject: [PATCH] Fix a couple race conditions. Checks if another game is already starting to boot before starting to boot a new one, and only change video backend, and dual core if a game is actually not running. --- Source/Core/DolphinWX/ConfigMain.cpp | 2 ++ Source/Core/DolphinWX/FrameTools.cpp | 2 ++ Source/Core/DolphinWX/VideoConfigDiag.h | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/ConfigMain.cpp b/Source/Core/DolphinWX/ConfigMain.cpp index 30f812ef7a..7ec5095bfc 100644 --- a/Source/Core/DolphinWX/ConfigMain.cpp +++ b/Source/Core/DolphinWX/ConfigMain.cpp @@ -882,6 +882,8 @@ void CConfigMain::CoreSettingsChanged(wxCommandEvent& event) { // Core - Basic case ID_CPUTHREAD: + if (Core::GetState() != Core::CORE_UNINITIALIZED) + return; SConfig::GetInstance().m_LocalCoreStartupParameter.bCPUThread = CPUThread->IsChecked(); break; case ID_IDLESKIP: diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 999243077d..23d09e345d 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -888,6 +888,8 @@ void CFrame::ToggleDisplayMode(bool bFullscreen) // Prepare the GUI to start the game. void CFrame::StartGame(const std::string& filename) { + if (m_bGameLoading) + return; m_bGameLoading = true; if (m_ToolBar) diff --git a/Source/Core/DolphinWX/VideoConfigDiag.h b/Source/Core/DolphinWX/VideoConfigDiag.h index 03aa45a941..695a01ee7a 100644 --- a/Source/Core/DolphinWX/VideoConfigDiag.h +++ b/Source/Core/DolphinWX/VideoConfigDiag.h @@ -20,6 +20,7 @@ #include "Common/CommonTypes.h" #include "Common/SysConf.h" #include "Core/ConfigManager.h" +#include "Core/Core.h" #include "Core/CoreParameter.h" #include "DolphinWX/WxUtils.h" #include "VideoCommon/VideoBackendBase.h" @@ -85,7 +86,7 @@ protected: VideoBackend* new_backend = g_available_video_backends[ev.GetInt()]; if (g_video_backend != new_backend) { - bool do_switch = true; + bool do_switch = Core::GetState() == Core::CORE_UNINITIALIZED; if (new_backend->GetName() == "Software Renderer") { do_switch = (wxYES == wxMessageBox(_("Software rendering is an order of magnitude slower than using the other backends.\nIt's only useful for debugging purposes.\nDo you really want to enable software rendering? If unsure, select 'No'."),