src/video/SDL_video.c
changeset 5288 d4381f3b0d1e
parent 5276 8e421890cdb8
child 5291 39208c821449
     1.1 --- a/src/video/SDL_video.c	Sun Feb 13 01:31:07 2011 -0800
     1.2 +++ b/src/video/SDL_video.c	Sun Feb 13 13:46:10 2011 -0800
     1.3 @@ -208,7 +208,7 @@
     1.4  SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
     1.5  {
     1.6      SDL_WindowTextureData *data;
     1.7 -    SDL_Renderer *renderer;
     1.8 +    SDL_Renderer *renderer = NULL;
     1.9      SDL_RendererInfo info;
    1.10      Uint32 i;
    1.11  
    1.12 @@ -1204,7 +1204,7 @@
    1.13  
    1.14      /* Tear down the old native window */
    1.15      if (window->surface) {
    1.16 -        window->surface->refcount = 0;
    1.17 +        window->surface->flags &= ~SDL_DONTFREE;
    1.18          SDL_FreeSurface(window->surface);
    1.19      }
    1.20      if (_this->DestroyWindowFramebuffer) {
    1.21 @@ -1622,13 +1622,13 @@
    1.22  
    1.23      if (!window->surface_valid) {
    1.24          if (window->surface) {
    1.25 -            window->surface->refcount = 0;
    1.26 +            window->surface->flags &= ~SDL_DONTFREE;
    1.27              SDL_FreeSurface(window->surface);
    1.28          }
    1.29          window->surface = SDL_CreateWindowFramebuffer(window);
    1.30          if (window->surface) {
    1.31              window->surface_valid = SDL_TRUE;
    1.32 -            window->surface->refcount = 0x7FFFFFF;
    1.33 +            window->surface->flags |= SDL_DONTFREE;
    1.34          }
    1.35      }
    1.36      return window->surface;
    1.37 @@ -1778,7 +1778,7 @@
    1.38      SDL_UpdateFullscreenMode(window, SDL_FALSE);
    1.39  
    1.40      if (window->surface) {
    1.41 -        window->surface->refcount = 0;
    1.42 +        window->surface->flags &= ~SDL_DONTFREE;
    1.43          SDL_FreeSurface(window->surface);
    1.44      }
    1.45      if (_this->DestroyWindowFramebuffer) {