src/video/SDL_video.c
changeset 7719 31b5f9ff36ca
parent 7698 a60b3c292f0f
child 7720 f9a649383362
     1.1 --- a/src/video/SDL_video.c	Thu Aug 29 08:27:25 2013 -0700
     1.2 +++ b/src/video/SDL_video.c	Thu Aug 29 08:29:21 2013 -0700
     1.3 @@ -263,10 +263,8 @@
     1.4          SDL_DestroyTexture(data->texture);
     1.5          data->texture = NULL;
     1.6      }
     1.7 -    if (data->pixels) {
     1.8 -        SDL_free(data->pixels);
     1.9 -        data->pixels = NULL;
    1.10 -    }
    1.11 +    SDL_free(data->pixels);
    1.12 +    data->pixels = NULL;
    1.13  
    1.14      if (SDL_GetRendererInfo(data->renderer, &info) < 0) {
    1.15          return -1;
    1.16 @@ -351,9 +349,7 @@
    1.17      if (data->renderer) {
    1.18          SDL_DestroyRenderer(data->renderer);
    1.19      }
    1.20 -    if (data->pixels) {
    1.21 -        SDL_free(data->pixels);
    1.22 -    }
    1.23 +    SDL_free(data->pixels);
    1.24      SDL_free(data);
    1.25  }
    1.26  
    1.27 @@ -1407,9 +1403,7 @@
    1.28      if (title == window->title) {
    1.29          return;
    1.30      }
    1.31 -    if (window->title) {
    1.32 -        SDL_free(window->title);
    1.33 -    }
    1.34 +    SDL_free(window->title);
    1.35      if (title && *title) {
    1.36          window->title = SDL_strdup(title);
    1.37      } else {
    1.38 @@ -2188,15 +2182,11 @@
    1.39      window->magic = NULL;
    1.40  
    1.41      /* Free memory associated with the window */
    1.42 -    if (window->title) {
    1.43 -        SDL_free(window->title);
    1.44 -    }
    1.45 +    SDL_free(window->title);
    1.46      if (window->icon) {
    1.47          SDL_FreeSurface(window->icon);
    1.48      }
    1.49 -    if (window->gamma) {
    1.50 -        SDL_free(window->gamma);
    1.51 -    }
    1.52 +    SDL_free(window->gamma);
    1.53      while (window->data) {
    1.54          SDL_WindowUserData *data = window->data;
    1.55  
    1.56 @@ -2283,23 +2273,15 @@
    1.57      for (i = 0; i < _this->num_displays; ++i) {
    1.58          SDL_VideoDisplay *display = &_this->displays[i];
    1.59          for (j = display->num_display_modes; j--;) {
    1.60 -            if (display->display_modes[j].driverdata) {
    1.61 -                SDL_free(display->display_modes[j].driverdata);
    1.62 -                display->display_modes[j].driverdata = NULL;
    1.63 -            }
    1.64 +            SDL_free(display->display_modes[j].driverdata);
    1.65 +            display->display_modes[j].driverdata = NULL;
    1.66          }
    1.67 -        if (display->display_modes) {
    1.68 -            SDL_free(display->display_modes);
    1.69 -            display->display_modes = NULL;
    1.70 -        }
    1.71 -        if (display->desktop_mode.driverdata) {
    1.72 -            SDL_free(display->desktop_mode.driverdata);
    1.73 -            display->desktop_mode.driverdata = NULL;
    1.74 -        }
    1.75 -        if (display->driverdata) {
    1.76 -            SDL_free(display->driverdata);
    1.77 -            display->driverdata = NULL;
    1.78 -        }
    1.79 +        SDL_free(display->display_modes);
    1.80 +        display->display_modes = NULL;
    1.81 +        SDL_free(display->desktop_mode.driverdata);
    1.82 +        display->desktop_mode.driverdata = NULL;
    1.83 +        SDL_free(display->driverdata);
    1.84 +        display->driverdata = NULL;
    1.85      }
    1.86      if (_this->displays) {
    1.87          for (i = 0; i < _this->num_displays; ++i) {
    1.88 @@ -2309,10 +2291,8 @@
    1.89          _this->displays = NULL;
    1.90          _this->num_displays = 0;
    1.91      }
    1.92 -    if (_this->clipboard_text) {
    1.93 -        SDL_free(_this->clipboard_text);
    1.94 -        _this->clipboard_text = NULL;
    1.95 -    }
    1.96 +    SDL_free(_this->clipboard_text);
    1.97 +    _this->clipboard_text = NULL;
    1.98      _this->free(_this);
    1.99      _this = NULL;
   1.100  }