From e1789b320edbd8644851bd793875baf32d3b31f6 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 25 Sep 2023 16:26:14 -0400
Subject: [PATCH] video: Streamline a little deinit code.
Fixes #8290.
---
src/video/SDL_video.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index fbd63a8c0227..4ea7a9363844 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -3747,12 +3747,11 @@ void SDL_VideoQuit(void)
SDL_VideoDisplay *display = _this->displays[i];
SDL_DelVideoDisplay(display->id, SDL_FALSE);
}
- if (_this->displays) {
- SDL_assert(_this->num_displays == 0);
- SDL_free(_this->displays);
- _this->displays = NULL;
- _this->num_displays = 0;
- }
+
+ SDL_assert(_this->num_displays == 0);
+ SDL_free(_this->displays);
+ _this->displays = NULL;
+
if (_this->primary_selection_text) {
SDL_free(_this->primary_selection_text);
_this->primary_selection_text = NULL;