src/haptic/windows/SDL_syshaptic.c
changeset 7719 31b5f9ff36ca
parent 7708 d5aa9910b1f7
child 7845 b92b8c52946c
     1.1 --- a/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:27:25 2013 -0700
     1.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Thu Aug 29 08:29:21 2013 -0700
     1.3 @@ -751,10 +751,8 @@
     1.4      }
     1.5  
     1.6      for (i = 0; i < SDL_arraysize(SDL_hapticlist); ++i) {
     1.7 -        if (SDL_hapticlist[i].name) {
     1.8 -            SDL_free(SDL_hapticlist[i].name);
     1.9 -            SDL_hapticlist[i].name = NULL;
    1.10 -        }
    1.11 +        SDL_free(SDL_hapticlist[i].name);
    1.12 +        SDL_hapticlist[i].name = NULL;
    1.13      }
    1.14  
    1.15      if (dinput != NULL) {
    1.16 @@ -1127,14 +1125,10 @@
    1.17  {
    1.18      DICUSTOMFORCE *custom;
    1.19  
    1.20 -    if (effect->lpEnvelope != NULL) {
    1.21 -        SDL_free(effect->lpEnvelope);
    1.22 -        effect->lpEnvelope = NULL;
    1.23 -    }
    1.24 -    if (effect->rgdwAxes != NULL) {
    1.25 -        SDL_free(effect->rgdwAxes);
    1.26 -        effect->rgdwAxes = NULL;
    1.27 -    }
    1.28 +    SDL_free(effect->lpEnvelope);
    1.29 +    effect->lpEnvelope = NULL;
    1.30 +    SDL_free(effect->rgdwAxes);
    1.31 +    effect->rgdwAxes = NULL;
    1.32      if (effect->lpvTypeSpecificParams != NULL) {
    1.33          if (type == SDL_HAPTIC_CUSTOM) {        /* Must free the custom data. */
    1.34              custom = (DICUSTOMFORCE *) effect->lpvTypeSpecificParams;
    1.35 @@ -1144,10 +1138,8 @@
    1.36          SDL_free(effect->lpvTypeSpecificParams);
    1.37          effect->lpvTypeSpecificParams = NULL;
    1.38      }
    1.39 -    if (effect->rglDirection != NULL) {
    1.40 -        SDL_free(effect->rglDirection);
    1.41 -        effect->rglDirection = NULL;
    1.42 -    }
    1.43 +    SDL_free(effect->rglDirection);
    1.44 +    effect->rglDirection = NULL;
    1.45  }
    1.46  
    1.47  
    1.48 @@ -1250,10 +1242,8 @@
    1.49    err_effectdone:
    1.50      SDL_SYS_HapticFreeDIEFFECT(&effect->hweffect->effect, base->type);
    1.51    err_hweffect:
    1.52 -    if (effect->hweffect != NULL) {
    1.53 -        SDL_free(effect->hweffect);
    1.54 -        effect->hweffect = NULL;
    1.55 -    }
    1.56 +    SDL_free(effect->hweffect);
    1.57 +    effect->hweffect = NULL;
    1.58      return -1;
    1.59  }
    1.60