mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-25 08:15:42 +00:00
- 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/d4e4d0fcda03 ).
This commit is contained in:
parent
8719a76535
commit
8c2c744ad5
|
@ -139,6 +139,7 @@ JoystickDeviceWasRemovedCallback(void *ctx, IOReturn result, void *sender)
|
|||
{
|
||||
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_SYS_JoystickDetect()
|
|||
SDL_bool
|
||||
SDL_SYS_JoystickNeedsPolling()
|
||||
{
|
||||
// BUGBUG - only works if someone else is pumping the CFRunLoop...
|
||||
return s_bDeviceAdded || s_bDeviceRemoved;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue