input: Close gamecontroller handles on disconnect

This commit is contained in:
Matt Borgerson 2020-11-20 14:10:06 -07:00 committed by mborgerson
parent 02157b0958
commit 2702f45cc3
1 changed files with 6 additions and 1 deletions

View File

@ -204,7 +204,12 @@ void xemu_input_process_sdl_events(const SDL_Event *event)
num_available_controllers--;
// Deallocate
// FIXME: Check to release any SDL handles, etc
if (iter->sdl_haptic) {
SDL_HapticClose(iter->sdl_haptic);
}
if (iter->sdl_gamecontroller) {
SDL_GameControllerClose(iter->sdl_gamecontroller);
}
free(iter);
handled = 1;