Christoph Mallon: Remove pointless if (x) before SDL_free(x)

This commit is contained in:
Sam Lantinga
2013-08-29 08:29:21 -07:00
parent 1d2c7796ae
commit f79fc33a39
63 changed files with 157 additions and 349 deletions

View File

@@ -834,7 +834,7 @@ void SDL_SYS_JoystickDetect()
pListNext = pCurList->pNext;
SDL_free(pCurList->joystickname);
SDL_free( pCurList );
SDL_free(pCurList);
pCurList = pListNext;
}
@@ -1559,10 +1559,8 @@ SDL_SYS_JoystickClose(SDL_Joystick * joystick)
IDirectInputDevice8_Release(joystick->hwdata->InputDevice);
}
if (joystick->hwdata != NULL) {
/* free system specific hardware data */
SDL_free(joystick->hwdata);
}
/* free system specific hardware data */
SDL_free(joystick->hwdata);
joystick->closed = 1;
}

View File

@@ -384,11 +384,9 @@ SDL_SYS_JoystickUpdate(SDL_Joystick * joystick)
void
SDL_SYS_JoystickClose(SDL_Joystick * joystick)
{
if (joystick->hwdata != NULL) {
/* free system specific hardware data */
SDL_free(joystick->hwdata);
joystick->hwdata = NULL;
}
/* free system specific hardware data */
SDL_free(joystick->hwdata);
joystick->hwdata = NULL;
}
/* Function to perform any system-specific joystick related cleanup */
@@ -397,10 +395,8 @@ SDL_SYS_JoystickQuit(void)
{
int i;
for (i = 0; i < MAX_JOYSTICKS; i++) {
if (SYS_JoystickName[i] != NULL) {
SDL_free(SYS_JoystickName[i]);
SYS_JoystickName[i] = NULL;
}
SDL_free(SYS_JoystickName[i]);
SYS_JoystickName[i] = NULL;
}
}