Browse Source

video: Minor cleanup in SDL_VideoQuit.

(This code changed in SDL3, no need to cherry-pick it to there.)
Ryan C. Gordon 1 year ago
parent
commit
1f4e86d61c
1 changed files with 6 additions and 10 deletions
  1. 6 10
      src/video/SDL_video.c

+ 6 - 10
src/video/SDL_video.c

@@ -3355,18 +3355,14 @@ void SDL_VideoQuit(void)
         SDL_VideoDisplay *display = &_this->displays[i];
         SDL_ResetDisplayModes(i);
         SDL_free(display->desktop_mode.driverdata);
-        display->desktop_mode.driverdata = NULL;
         SDL_free(display->driverdata);
-        display->driverdata = NULL;
-    }
-    if (_this->displays) {
-        for (i = 0; i < _this->num_displays; ++i) {
-            SDL_free(_this->displays[i].name);
-        }
-        SDL_free(_this->displays);
-        _this->displays = NULL;
-        _this->num_displays = 0;
+        SDL_free(display->name);
     }
+
+    SDL_free(_this->displays);
+    _this->displays = NULL;
+    _this->num_displays = 0;
+
     SDL_free(_this->clipboard_text);
     _this->clipboard_text = NULL;
     _this->free(_this);