From a64c0fd161b9f85787008b9ca5bcf466b861e84a Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 16 Jul 2022 15:39:50 +0300 Subject: [PATCH 48/48] sdl2: Fix create_select_tech_icon() surface leak See osdn #45035 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/repodlgs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/gui-sdl2/repodlgs.c b/client/gui-sdl2/repodlgs.c index f81ec3d5cf..a863cdc9ec 100644 --- a/client/gui-sdl2/repodlgs.c +++ b/client/gui-sdl2/repodlgs.c @@ -2544,6 +2544,7 @@ SDL_Surface *create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id, dst.x = (surf->w - surf_array[0]->w) / 2; alphablit(surf_array[0], NULL, surf, &dst, 255); } + FREESURFACE(surf_array[0]); } else { float zoom; @@ -2558,6 +2559,7 @@ SDL_Surface *create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id, while (w) { SDL_Surface *zoomed = zoomSurface((*buf_array), zoom, zoom, 1); + FREESURFACE(*buf_array); alphablit(zoomed, NULL, surf, &dst, 255); dst.x += zoomed->w + 2; w--; -- 2.35.1