src/video/SDL_video.c
changeset 5288 d4381f3b0d1e
parent 5276 8e421890cdb8
child 5291 39208c821449
--- a/src/video/SDL_video.c	Sun Feb 13 01:31:07 2011 -0800
+++ b/src/video/SDL_video.c	Sun Feb 13 13:46:10 2011 -0800
@@ -208,7 +208,7 @@
 SDL_CreateWindowTexture(_THIS, SDL_Window * window, Uint32 * format, void ** pixels, int *pitch)
 {
     SDL_WindowTextureData *data;
-    SDL_Renderer *renderer;
+    SDL_Renderer *renderer = NULL;
     SDL_RendererInfo info;
     Uint32 i;
 
@@ -1204,7 +1204,7 @@
 
     /* Tear down the old native window */
     if (window->surface) {
-        window->surface->refcount = 0;
+        window->surface->flags &= ~SDL_DONTFREE;
         SDL_FreeSurface(window->surface);
     }
     if (_this->DestroyWindowFramebuffer) {
@@ -1622,13 +1622,13 @@
 
     if (!window->surface_valid) {
         if (window->surface) {
-            window->surface->refcount = 0;
+            window->surface->flags &= ~SDL_DONTFREE;
             SDL_FreeSurface(window->surface);
         }
         window->surface = SDL_CreateWindowFramebuffer(window);
         if (window->surface) {
             window->surface_valid = SDL_TRUE;
-            window->surface->refcount = 0x7FFFFFF;
+            window->surface->flags |= SDL_DONTFREE;
         }
     }
     return window->surface;
@@ -1778,7 +1778,7 @@
     SDL_UpdateFullscreenMode(window, SDL_FALSE);
 
     if (window->surface) {
-        window->surface->refcount = 0;
+        window->surface->flags &= ~SDL_DONTFREE;
         SDL_FreeSurface(window->surface);
     }
     if (_this->DestroyWindowFramebuffer) {