mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 22:29:39 -06:00
ControllerInterface: replace Reinitialize with RefreshDevices
The SDL backend crashes when you close a joystick after SDL_Quit has been called. Some backends don't need to be shutdown and re-initialized everytime, we can just ask to enumerate devices again.
This commit is contained in:
@ -47,6 +47,12 @@ void Init()
|
||||
// Failed to initialize
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void PopulateDevices()
|
||||
{
|
||||
if (!(SDL_WasInit(SDL_INIT_EVERYTHING) & SDL_INIT_JOYSTICK))
|
||||
return;
|
||||
|
||||
// joysticks
|
||||
for (int i = 0; i < SDL_NumJoysticks(); ++i)
|
||||
|
@ -21,6 +21,7 @@ namespace ciface
|
||||
namespace SDL
|
||||
{
|
||||
void Init();
|
||||
void PopulateDevices();
|
||||
|
||||
class Joystick : public Core::Device
|
||||
{
|
||||
|
Reference in New Issue
Block a user