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 1796 - SDL_JOYDEVICEREMOVED not triggering
Summary: SDL_JOYDEVICEREMOVED not triggering
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: x86_64 Mac OS X 10.7
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-10 21:26 UTC by Alex Szpakowski
Modified: 2013-05-11 17:05 UTC (History)
0 users

See Also:


Attachments
Simple program used to test joystick add/remove events. (799 bytes, application/octet-stream)
2013-04-10 21:26 UTC, Alex Szpakowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Szpakowski 2013-04-10 21:26:34 UTC
Created attachment 1107 [details]
Simple program used to test joystick add/remove events.

On my system (MBP with Mac OS 10.8.3, using a wired Xbox 360 controller with the tattiebogle driver), SDL_JOYDEVICEADDED is triggered correctly when the controller is plugged in, but SDL_JOYDEVICEREMOVED never happens when I unplug it. This results in a buildup of 'ghost joysticks' when the controller is unplugged and re-plugged multiple times.

I dug a little bit into the SDL2 source, and it seems joystick->hwdata->removed is being set properly, but SDL_SYS_JoystickUpdate (which does the actual removal and event triggering) is apparently not being called at all when that happens.

I have only tested this in Mac OS 10.8.3.
Comment 1 Alex Szpakowski 2013-05-11 17:05:55 UTC
This appears to be fixed as of revision 141ffce8bb59 (http://hg.libsdl.org/SDL/rev/141ffce8bb59)