src/video/SDL_video.c
changeset 2328 91e601d9df8b
parent 2324 3202e4826c57
child 2357 ad4a291c85ab
child 2540 56cf872c723a
child 2669 e27bdcc80744
     1.1 --- a/src/video/SDL_video.c	Fri Mar 07 23:57:15 2008 +0000
     1.2 +++ b/src/video/SDL_video.c	Fri Mar 14 18:17:49 2008 +0000
     1.3 @@ -1329,15 +1329,17 @@
     1.4              if (window->id != windowID) {
     1.5                  continue;
     1.6              }
     1.7 +            if (window->title) {
     1.8 +                SDL_free(window->title);
     1.9 +                window->title = NULL;
    1.10 +            }
    1.11              if (window->renderer) {
    1.12                  SDL_DestroyRenderer(window->id);
    1.13 +                window->renderer = NULL;
    1.14              }
    1.15              if (_this->DestroyWindow) {
    1.16                  _this->DestroyWindow(_this, window);
    1.17              }
    1.18 -            if (window->title) {
    1.19 -                SDL_free(window->title);
    1.20 -            }
    1.21              if (j != display->num_windows - 1) {
    1.22                  SDL_memcpy(&display->windows[i],
    1.23                             &display->windows[i + 1],
    1.24 @@ -1439,9 +1441,8 @@
    1.25      SDL_DestroyRenderer(windowID);
    1.26  
    1.27      /* Create a new renderer instance */
    1.28 -    window->renderer =
    1.29 -        SDL_CurrentDisplay.render_drivers[index].CreateRenderer(window,
    1.30 -                                                                flags);
    1.31 +    window->renderer = SDL_CurrentDisplay.render_drivers[index]
    1.32 +        .CreateRenderer(window, flags);
    1.33      SDL_SelectRenderer(window->id);
    1.34  
    1.35      return 0;
    1.36 @@ -2220,9 +2221,11 @@
    1.37          }
    1.38          if (display->gamma) {
    1.39              SDL_free(display->gamma);
    1.40 +            display->gamma = NULL;
    1.41          }
    1.42          if (display->driverdata) {
    1.43              SDL_free(display->driverdata);
    1.44 +            display->driverdata = NULL;
    1.45          }
    1.46      }
    1.47      if (_this->displays) {