Pārlūkot izejas kodu

Don't duplicate the serial number twice if a child doesn't set one

Sam Lantinga 3 gadi atpakaļ
vecāks
revīzija
201484ff6f
1 mainītis faili ar 2 papildinājumiem un 0 dzēšanām
  1. 2 0
      src/joystick/hidapi/SDL_hidapi_combined.c

+ 2 - 0
src/joystick/hidapi/SDL_hidapi_combined.c

@@ -94,6 +94,8 @@ HIDAPI_DriverCombined_OpenJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joys
                 serial = new_serial;
                 serial = new_serial;
                 serial_length = new_length;
                 serial_length = new_length;
             }
             }
+            SDL_free(joystick->serial);
+            joystick->serial = NULL;
         }
         }
     }
     }