From 894fbd0bc61145809242c3af6eaf4f02fdabfadf Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 14 Jun 2022 18:01:03 +0300 Subject: [PATCH 47/47] gtk3.22: Unref ui_builder See osdn #44832 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.22/gui_main.c | 1 + client/gui-gtk-3.22/menu.c | 11 +++++++++++ client/gui-gtk-3.22/menu.h | 1 + 3 files changed, 13 insertions(+) diff --git a/client/gui-gtk-3.22/gui_main.c b/client/gui-gtk-3.22/gui_main.c index 6bb7d435bd..3a1e892a50 100644 --- a/client/gui-gtk-3.22/gui_main.c +++ b/client/gui-gtk-3.22/gui_main.c @@ -1989,6 +1989,7 @@ void ui_main(int argc, char **argv) editgui_free(); gtk_widget_destroy(toplevel_tabs); gtk_widget_destroy(toplevel); + menus_free(); message_buffer = NULL; /* Result of destruction of everything */ tileset_free_tiles(tileset); } diff --git a/client/gui-gtk-3.22/menu.c b/client/gui-gtk-3.22/menu.c index f08cecd062..ccc6e36d92 100644 --- a/client/gui-gtk-3.22/menu.c +++ b/client/gui-gtk-3.22/menu.c @@ -2941,3 +2941,14 @@ void real_menus_init(void) menu_entry_set_active("FULL_SCREEN", GUI_GTK_OPTION(fullscreen)); } + +/************************************************************************** + Free resources allocated by the menu system. +**************************************************************************/ +void menus_free(void) +{ + if (ui_builder != NULL) { + g_object_unref(ui_builder); + ui_builder = NULL; + } +} diff --git a/client/gui-gtk-3.22/menu.h b/client/gui-gtk-3.22/menu.h index 0500e08460..1c16591409 100644 --- a/client/gui-gtk-3.22/menu.h +++ b/client/gui-gtk-3.22/menu.h @@ -19,5 +19,6 @@ #include "menu_g.h" GtkWidget *setup_menus(GtkWidget *window); +void menus_free(void); #endif /* FC__MENU_H */ -- 2.35.1