From 9796b54b28720945273e3a9f23a3a1728395ed12 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 28 Jul 2022 04:28:49 +0300 Subject: [PATCH 28/28] sdl2: Clean up at exit - Destroy main texture - Destroy renderer - Free main surface See osdn #45033 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/graphics.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/client/gui-sdl2/graphics.c b/client/gui-sdl2/graphics.c index d26f217512..7e2b891b59 100644 --- a/client/gui-sdl2/graphics.c +++ b/client/gui-sdl2/graphics.c @@ -543,6 +543,9 @@ void quit_sdl(void) gui_layer_destroy(&Main.gui); FREESURFACE(Main.map); FREESURFACE(Main.dummy); + SDL_DestroyTexture(Main.maintext); + SDL_DestroyRenderer(Main.renderer); + FREESURFACE(main_surface); } /************************************************************************** @@ -569,9 +572,9 @@ int set_video_mode(int iWidth, int iHeight, int iFlags) } if (is_bigendian()) { - main_surface = SDL_CreateRGBSurface(0, iWidth, iHeight, 32, - 0x0000FF00, 0x00FF0000, - 0xFF000000, 0x000000FF); + main_surface = SDL_CreateRGBSurface(0, iWidth, iHeight, 32, + 0x0000FF00, 0x00FF0000, + 0xFF000000, 0x000000FF); } else { main_surface = SDL_CreateRGBSurface(0, iWidth, iHeight, 32, 0x00FF0000, 0x0000FF00, -- 2.35.1