mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-11-11 04:55:23 +00:00
Don't do NULL-checks before SDL_free()
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
This commit is contained in:
committed by
Sam Lantinga
parent
2f810e0a5f
commit
aaee09d6ed
@@ -1237,12 +1237,8 @@ static void DelController(SDL_JoystickID id)
|
||||
CyclePS5TriggerEffect(&controllers[i]);
|
||||
}
|
||||
SDL_assert(controllers[i].gamepad == NULL);
|
||||
if (controllers[i].axis_state) {
|
||||
SDL_free(controllers[i].axis_state);
|
||||
}
|
||||
if (controllers[i].imu_state) {
|
||||
SDL_free(controllers[i].imu_state);
|
||||
}
|
||||
SDL_free(controllers[i].axis_state);
|
||||
SDL_free(controllers[i].imu_state);
|
||||
if (controllers[i].joystick) {
|
||||
SDL_CloseJoystick(controllers[i].joystick);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user