From 45e8d9392906ed65ad7a07023e23fc8bc5e165f1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 22 Aug 2022 06:07:18 +0300 Subject: [PATCH 20/20] sdl2: Fix science_report_dialog_popup() theme leak See osdn #45422 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/repodlgs.c | 1 + client/gui-sdl2/widget_window.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/gui-sdl2/repodlgs.c b/client/gui-sdl2/repodlgs.c index ec7f9ef37c..d0edc236d9 100644 --- a/client/gui-sdl2/repodlgs.c +++ b/client/gui-sdl2/repodlgs.c @@ -3373,6 +3373,7 @@ void science_report_dialog_popup(bool raise) pScienceDlg->pEndWidgetList = pWindow; pBackground = theme_get_background(theme, BACKGROUND_SCIENCEDLG); + FREESURFACE(pWindow->theme); pWindow->theme = ResizeSurface(pBackground, pWindow->size.w, pWindow->size.h, 1); FREESURFACE(pBackground); diff --git a/client/gui-sdl2/widget_window.c b/client/gui-sdl2/widget_window.c index e24b86a941..fddee1674c 100644 --- a/client/gui-sdl2/widget_window.c +++ b/client/gui-sdl2/widget_window.c @@ -228,7 +228,7 @@ struct widget *create_window_skeleton(struct gui_layer *pDest, /************************************************************************** Create window widget **************************************************************************/ -struct widget *create_window(struct gui_layer *pDest, utf8_str *title, +struct widget *create_window(struct gui_layer *pDest, utf8_str *title, Uint16 w, Uint16 h, Uint32 flags) { struct widget *pWindow = create_window_skeleton(pDest, title, flags); -- 2.35.1