diff --git a/gnucash/gnome-utils/gnc-gtk-utils.c b/gnucash/gnome-utils/gnc-gtk-utils.c index a023cd4b7f..c3c8fad1e8 100644 --- a/gnucash/gnome-utils/gnc-gtk-utils.c +++ b/gnucash/gnome-utils/gnc-gtk-utils.c @@ -907,6 +907,7 @@ gnc_menubar_model_update_item (GMenuModel *menu_model, const gchar *action_name, g_menu_remove (G_MENU(gsm->model), gsm->index); g_menu_insert_item (G_MENU(gsm->model), gsm->index, item); + g_object_unref (item); found = TRUE; } if (old_target) diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp index e5b5f0929a..5dd830edf8 100644 --- a/gnucash/gnome-utils/gnc-main-window.cpp +++ b/gnucash/gnome-utils/gnc-main-window.cpp @@ -1820,6 +1820,7 @@ gnc_main_window_update_one_menu_action (GncMainWindow *window, if (pos < g_menu_model_get_n_items (gsm->model)) g_menu_remove (G_MENU(gsm->model), pos); g_menu_insert_item (G_MENU(gsm->model), pos, item); + g_object_unref (item); g_free (gsm); LEAVE(" "); diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c index 45174ba0bb..6b2c435af0 100644 --- a/gnucash/gnome-utils/gnc-plugin-file-history.c +++ b/gnucash/gnome-utils/gnc-plugin-file-history.c @@ -459,6 +459,7 @@ gnc_history_update_action (GncMainWindow *window, g_free (full_action_name); g_free (label_name); g_free (tooltip); + g_object_unref (item); } g_free (gsm); g_free (action_name); diff --git a/gnucash/gnome-utils/gnc-plugin-menu-additions.c b/gnucash/gnome-utils/gnc-plugin-menu-additions.c index 98ef68cb9b..69051b8630 100644 --- a/gnucash/gnome-utils/gnc-plugin-menu-additions.c +++ b/gnucash/gnome-utils/gnc-plugin-menu-additions.c @@ -481,7 +481,7 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin, menu_plugin->item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); per_window.item_hash = menu_plugin->item_hash; - per_window.build_menu_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + per_window.build_menu_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); per_window.report_menu = g_menu_new (); menu_list = g_slist_sort (gnc_extensions_get_menu_list(),