From 9d9461a586c4ffff898d46109966f1845a504ebb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 28 Jul 2022 04:25:19 +0300 Subject: [PATCH 51/51] 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 7da1ae6782..ff0b70a6c4 100644 --- a/client/gui-sdl2/graphics.c +++ b/client/gui-sdl2/graphics.c @@ -545,6 +545,9 @@ void quit_sdl(void) gui_layer_destroy(&main_data.gui); FREESURFACE(main_data.map); FREESURFACE(main_data.dummy); + SDL_DestroyTexture(main_data.maintext); + SDL_DestroyRenderer(main_data.renderer); + FREESURFACE(main_surface); } /**********************************************************************//** @@ -571,9 +574,9 @@ int set_video_mode(int width, int height, int flags_in) } if (is_bigendian()) { - main_surface = SDL_CreateRGBSurface(0, width, height, 32, - 0x0000FF00, 0x00FF0000, - 0xFF000000, 0x000000FF); + main_surface = SDL_CreateRGBSurface(0, width, height, 32, + 0x0000FF00, 0x00FF0000, + 0xFF000000, 0x000000FF); } else { main_surface = SDL_CreateRGBSurface(0, width, height, 32, 0x00FF0000, 0x0000FF00, -- 2.35.1