diff src/video/SDL_video.c @ 2328:91e601d9df8b

re: bug#563. checking in some commented out trace code and a fix so that the in testalpha.c the background only flashes when alpha == 255. The problem that is being fixed is caused by clearing SDL_COPY_RLE_COLORKEY without setting SDL_COPY_RLE_DESIRED in SDL_UnRELSurface.
author Bob Pendleton <bob@pendleton.com>
date Fri, 14 Mar 2008 18:17:49 +0000
parents 3202e4826c57
children ad4a291c85ab 56cf872c723a e27bdcc80744
line wrap: on
line diff
--- a/src/video/SDL_video.c	Fri Mar 07 23:57:15 2008 +0000
+++ b/src/video/SDL_video.c	Fri Mar 14 18:17:49 2008 +0000
@@ -1329,15 +1329,17 @@
             if (window->id != windowID) {
                 continue;
             }
+            if (window->title) {
+                SDL_free(window->title);
+                window->title = NULL;
+            }
             if (window->renderer) {
                 SDL_DestroyRenderer(window->id);
+                window->renderer = NULL;
             }
             if (_this->DestroyWindow) {
                 _this->DestroyWindow(_this, window);
             }
-            if (window->title) {
-                SDL_free(window->title);
-            }
             if (j != display->num_windows - 1) {
                 SDL_memcpy(&display->windows[i],
                            &display->windows[i + 1],
@@ -1439,9 +1441,8 @@
     SDL_DestroyRenderer(windowID);
 
     /* Create a new renderer instance */
-    window->renderer =
-        SDL_CurrentDisplay.render_drivers[index].CreateRenderer(window,
-                                                                flags);
+    window->renderer = SDL_CurrentDisplay.render_drivers[index]
+        .CreateRenderer(window, flags);
     SDL_SelectRenderer(window->id);
 
     return 0;
@@ -2220,9 +2221,11 @@
         }
         if (display->gamma) {
             SDL_free(display->gamma);
+            display->gamma = NULL;
         }
         if (display->driverdata) {
             SDL_free(display->driverdata);
+            display->driverdata = NULL;
         }
     }
     if (_this->displays) {