src/joystick/darwin/SDL_sysjoystick.c
changeset 13642 f4ae4b91cf38
parent 13638 ca87b62e4e17
child 13646 784ce9766fb9
     1.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Mon Mar 16 22:34:33 2020 -0700
     1.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Tue Mar 17 02:31:47 2020 -0400
     1.3 @@ -125,7 +125,6 @@
     1.4  FreeDevice(recDevice *removeDevice)
     1.5  {
     1.6      recDevice *pDeviceNext = NULL;
     1.7 -    SDL_Joystick *joystick = NULL;
     1.8      if (removeDevice) {
     1.9          if (removeDevice->deviceRef) {
    1.10              IOHIDDeviceUnscheduleFromRunLoop(removeDevice->deviceRef, CFRunLoopGetCurrent(), SDL_JOYSTICK_RUNLOOP_MODE);
    1.11 @@ -147,14 +146,6 @@
    1.12          }
    1.13          removeDevice->pNext = NULL;
    1.14  
    1.15 -        /* clear out any reference to this recDevice that are being
    1.16 -         * held by a live instance of SDL_Joystick
    1.17 -         */
    1.18 -        joystick = SDL_JoystickFromInstanceID(removeDevice->instance_id);
    1.19 -        if (joystick) {
    1.20 -            joystick->hwdata = NULL;
    1.21 -        }
    1.22 -
    1.23          /* free element lists */
    1.24          FreeElementList(removeDevice->firstAxis);
    1.25          FreeElementList(removeDevice->firstButton);
    1.26 @@ -880,10 +871,6 @@
    1.27      /* Scale and average the two rumble strengths */
    1.28      Sint16 magnitude = (Sint16)(((low_frequency_rumble / 2) + (high_frequency_rumble / 2)) / 2);
    1.29  
    1.30 -    if (!device) {
    1.31 -        return SDL_SetError("Rumble failed, device disconnected");
    1.32 -    }
    1.33 -
    1.34      if (!device->ffservice) {
    1.35          return SDL_Unsupported();
    1.36      }