We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4640

Summary: joysticks send events after the joystick removed event
Product: SDL Reporter: Nicolas Adenis-Lamarre <nicolas.adenis.lamarre>
Component: joystickAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: 2.0.9Keywords: target-2.0.14
Hardware: All   
OS: Linux   

Description Nicolas Adenis-Lamarre 2019-05-21 19:14:19 UTC
since i upgraded to sdl 2.0.9, i got joysticks events from sdl after the joystick closed event.
it may be considered as a bug.

on batocera.linux, i've done a patch to fix that behavior : https://github.com/batocera-linux/batocera.linux/commit/ed0d55420427f0c117bc6d990b9d2ee4563b49d0

basically,i don't call SDL_JoystickUpdate once the joystick is no more attached.

the call stack is the same as the one reported by retropie here : https://github.com/RetroPie/EmulationStation/issues/552
Comment 1 Ryan C. Gordon 2020-03-26 22:56:20 UTC
I believe the fix I just did for Bug #5063 should resolve this specific thing too, except on macOS when not using hidapi. I'll leave this bug open and assigned to me until I clean that out.

--ryan.
Comment 2 Ryan C. Gordon 2020-04-08 03:48:09 UTC
macOS joystick code does the right thing without this flag, so I've removed it with https://hg.libsdl.org/SDL/rev/99bad97fec09, so this bug can be resolved.

Please reopen if you have any further problems, but I think this should resolve the issue.

--ryan.