ControllerInterface: Allow hotplug callbacks to be unregistered and don't reload the entire config from the ini file on hotplug, just update the control references. This should fix a crash on shutdown on Android.

This commit is contained in:
Jordan Woyak 2019-01-10 09:02:38 -06:00
parent c2afcb0f6b
commit b425f86121
10 changed files with 62 additions and 16 deletions

View file

@ -238,7 +238,7 @@ void Initialize()
if (s_config.ControllersNeedToBeCreated())
s_config.CreateController<HotkeyManager>();
g_controller_interface.RegisterDevicesChangedCallback(LoadConfig);
s_config.RegisterHotplugCallback();
// load the saved controller config
s_config.LoadConfig(true);
@ -260,9 +260,11 @@ ControllerEmu::ControlGroup* GetHotkeyGroup(HotkeyGroup group)
void Shutdown()
{
s_config.UnregisterHotplugCallback();
s_config.ClearControllers();
}
}
} // namespace HotkeyManagerEmu
struct HotkeyGroupInfo
{