From 3709a1ce3af08d5fdcf653fb81c2a6a7e2bbd2ae Mon Sep 17 00:00:00 2001 From: skidau Date: Wed, 4 Feb 2015 18:48:19 +1100 Subject: [PATCH] Fixed the crash which occurred when opening Wiimote configuration before a game was started. --- Source/Core/Core/Core.cpp | 3 +-- Source/Core/Core/HW/Wiimote.cpp | 5 +++-- Source/Core/DolphinWX/Frame.cpp | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Core.cpp b/Source/Core/Core/Core.cpp index d2ee643bdf..30d64b6d38 100644 --- a/Source/Core/Core/Core.cpp +++ b/Source/Core/Core/Core.cpp @@ -484,10 +484,9 @@ void EmuThread() HW::Shutdown(); INFO_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str()); - Wiimote::Shutdown(); - if (init_controllers) { + Wiimote::Shutdown(); Keyboard::Shutdown(); Pad::Shutdown(); init_controllers = false; diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index e7636b3429..357b3b1fea 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -40,8 +40,9 @@ void Shutdown() void Initialize(void* const hwnd, bool wait) { // add 4 Wiimotes - for (unsigned int i = WIIMOTE_CHAN_0; i(win)); Pad::Initialize(reinterpret_cast(win)); Keyboard::Initialize(reinterpret_cast(win)); + Wiimote::Initialize(reinterpret_cast(win)); #else HotkeyManagerEmu::Initialize(reinterpret_cast(GetHandle())); Pad::Initialize(reinterpret_cast(GetHandle())); Keyboard::Initialize(reinterpret_cast(GetHandle())); + Wiimote::Initialize(reinterpret_cast(GetHandle())); #endif return true; } @@ -516,9 +519,10 @@ CFrame::~CFrame() if (m_bHotkeysInit) { - HotkeyManagerEmu::Shutdown(); + Wiimote::Shutdown(); Keyboard::Shutdown(); Pad::Shutdown(); + HotkeyManagerEmu::Shutdown(); m_bHotkeysInit = false; }