From 3e69d066f5e9ad0a1097d806c656035398bbb7bc Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Sun, 16 Oct 2016 13:39:05 -0700 Subject: 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. --- Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp') diff --git a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp index 8f8265e8d0..7da8e66fc6 100644 --- a/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp +++ b/Source/Core/InputCommon/ControllerInterface/SDL/SDL.cpp @@ -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) -- cgit v1.2.3