mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fixed the crash which occurred when opening Wiimote configuration before a game was started.
This commit is contained in:
@ -484,10 +484,9 @@ void EmuThread()
|
|||||||
HW::Shutdown();
|
HW::Shutdown();
|
||||||
INFO_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str());
|
INFO_LOG(CONSOLE, "%s", StopMessage(false, "HW shutdown").c_str());
|
||||||
|
|
||||||
Wiimote::Shutdown();
|
|
||||||
|
|
||||||
if (init_controllers)
|
if (init_controllers)
|
||||||
{
|
{
|
||||||
|
Wiimote::Shutdown();
|
||||||
Keyboard::Shutdown();
|
Keyboard::Shutdown();
|
||||||
Pad::Shutdown();
|
Pad::Shutdown();
|
||||||
init_controllers = false;
|
init_controllers = false;
|
||||||
|
@ -40,8 +40,9 @@ void Shutdown()
|
|||||||
void Initialize(void* const hwnd, bool wait)
|
void Initialize(void* const hwnd, bool wait)
|
||||||
{
|
{
|
||||||
// add 4 Wiimotes
|
// add 4 Wiimotes
|
||||||
for (unsigned int i = WIIMOTE_CHAN_0; i<MAX_BBMOTES; ++i)
|
if (s_config.controllers.empty())
|
||||||
s_config.controllers.push_back(new WiimoteEmu::Wiimote(i));
|
for (unsigned int i = WIIMOTE_CHAN_0; i < MAX_BBMOTES; ++i)
|
||||||
|
s_config.controllers.push_back(new WiimoteEmu::Wiimote(i));
|
||||||
|
|
||||||
g_controller_interface.Initialize(hwnd);
|
g_controller_interface.Initialize(hwnd);
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include "Core/HW/DVDInterface.h"
|
#include "Core/HW/DVDInterface.h"
|
||||||
#include "Core/HW/GCKeyboard.h"
|
#include "Core/HW/GCKeyboard.h"
|
||||||
#include "Core/HW/GCPad.h"
|
#include "Core/HW/GCPad.h"
|
||||||
|
#include "Core/HW/Wiimote.h"
|
||||||
|
|
||||||
#include "DolphinWX/Frame.h"
|
#include "DolphinWX/Frame.h"
|
||||||
#include "DolphinWX/GameListCtrl.h"
|
#include "DolphinWX/GameListCtrl.h"
|
||||||
@ -356,10 +357,12 @@ bool CFrame::InitControllers()
|
|||||||
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
|
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(win));
|
||||||
Pad::Initialize(reinterpret_cast<void*>(win));
|
Pad::Initialize(reinterpret_cast<void*>(win));
|
||||||
Keyboard::Initialize(reinterpret_cast<void*>(win));
|
Keyboard::Initialize(reinterpret_cast<void*>(win));
|
||||||
|
Wiimote::Initialize(reinterpret_cast<void*>(win));
|
||||||
#else
|
#else
|
||||||
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
|
HotkeyManagerEmu::Initialize(reinterpret_cast<void*>(GetHandle()));
|
||||||
Pad::Initialize(reinterpret_cast<void*>(GetHandle()));
|
Pad::Initialize(reinterpret_cast<void*>(GetHandle()));
|
||||||
Keyboard::Initialize(reinterpret_cast<void*>(GetHandle()));
|
Keyboard::Initialize(reinterpret_cast<void*>(GetHandle()));
|
||||||
|
Wiimote::Initialize(reinterpret_cast<void*>(GetHandle()));
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -516,9 +519,10 @@ CFrame::~CFrame()
|
|||||||
|
|
||||||
if (m_bHotkeysInit)
|
if (m_bHotkeysInit)
|
||||||
{
|
{
|
||||||
HotkeyManagerEmu::Shutdown();
|
Wiimote::Shutdown();
|
||||||
Keyboard::Shutdown();
|
Keyboard::Shutdown();
|
||||||
Pad::Shutdown();
|
Pad::Shutdown();
|
||||||
|
HotkeyManagerEmu::Shutdown();
|
||||||
m_bHotkeysInit = false;
|
m_bHotkeysInit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user