- fixed crash if you removed a device twice, the deviceRef is invalid if removed from the removed device callback (added in http://hg.libsdl.org/SDL/rev/153077041e4b ).
--- a/src/joystick/darwin/SDL_sysjoystick.c Tue Jun 10 19:39:33 2014 -0400
+++ b/src/joystick/darwin/SDL_sysjoystick.c Fri Jun 13 10:50:24 2014 -0700
@@ -139,6 +139,7 @@
{
recDevice *device = (recDevice *) ctx;
device->removed = 1;
+ device->deviceRef = NULL; // deviceRef was invalidated due to the remove
#if SDL_HAPTIC_IOKIT
MacHaptic_MaybeRemoveDevice(device->ffservice);
#endif
@@ -603,6 +604,7 @@
SDL_bool
SDL_SYS_JoystickNeedsPolling()
{
+ // BUGBUG - only works if someone else is pumping the CFRunLoop...
return s_bDeviceAdded || s_bDeviceRemoved;
}