src/joystick/android/SDL_sysjoystick.c
changeset 10082 e1e10dfb04ad
parent 10081 a858fbc2e1f8
child 10274 3501018c6df2
equal deleted inserted replaced
10081:a858fbc2e1f8 10082:e1e10dfb04ad
   321 int 
   321 int 
   322 Android_RemoveJoystick(int device_id)
   322 Android_RemoveJoystick(int device_id)
   323 {
   323 {
   324     SDL_joylist_item *item = SDL_joylist;
   324     SDL_joylist_item *item = SDL_joylist;
   325     SDL_joylist_item *prev = NULL;
   325     SDL_joylist_item *prev = NULL;
   326     int retval;
       
   327 #if !SDL_EVENTS_DISABLED
   326 #if !SDL_EVENTS_DISABLED
   328     SDL_Event event;
   327     SDL_Event event;
   329 #endif
   328 #endif
   330     
   329     
   331     /* Don't call JoystickByDeviceId here or there'll be an infinite loop! */
   330     /* Don't call JoystickByDeviceId here or there'll be an infinite loop! */
   339     
   338     
   340     if (item == NULL) {
   339     if (item == NULL) {
   341         return -1;
   340         return -1;
   342     }
   341     }
   343 
   342 
   344     retval = item->device_instance;
       
   345     if (item->joystick) {
   343     if (item->joystick) {
   346         item->joystick->hwdata = NULL;
   344         item->joystick->hwdata = NULL;
   347     }
   345     }
   348         
   346         
   349     if (prev != NULL) {
   347     if (prev != NULL) {