Initialised all controller interfaces together on CFrame construction to fix the crash that would occur if the controller config were opened before a game was started.

This commit is contained in:
skidau
2015-02-04 18:05:22 +11:00
parent 5e645732f2
commit b9fb6ad3e8
6 changed files with 35 additions and 14 deletions

View File

@ -361,8 +361,13 @@ void EmuThread()
return;
}
Keyboard::Initialize(s_window_handle);
Pad::Initialize(s_window_handle);
bool init_controllers = false;
if (!g_controller_interface.IsInit())
{
Pad::Initialize(s_window_handle);
Keyboard::Initialize(s_window_handle);
init_controllers = true;
}
// Load and Init Wiimotes - only if we are booting in Wii mode
if (core_parameter.bWii)
@ -481,8 +486,12 @@ void EmuThread()
Wiimote::Shutdown();
Keyboard::Shutdown();
Pad::Shutdown();
if (init_controllers)
{
Keyboard::Shutdown();
Pad::Shutdown();
init_controllers = false;
}
g_video_backend->Shutdown();
AudioCommon::ShutdownSoundStream();