From e9bab3bf98fc8942e9ac62495d2fb13bc59a612e Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 27 Jul 2019 17:49:29 +0100 Subject: [PATCH] Add the removal of preference call backs to gnc_gui_destroy Add the removal of preferences setup in gnc-gnome-utils and also call the other two functions to remove further preference call backs. --- gnucash/gnome-utils/gnc-gnome-utils.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gnucash/gnome-utils/gnc-gnome-utils.c b/gnucash/gnome-utils/gnc-gnome-utils.c index 87631690fe..ef389cf661 100644 --- a/gnucash/gnome-utils/gnc-gnome-utils.c +++ b/gnucash/gnome-utils/gnc-gnome-utils.c @@ -748,6 +748,31 @@ gnc_gui_destroy (void) if (!gnome_is_initialized) return; + if (gnc_prefs_is_set_up()) + { + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_FORMAT, + gnc_configure_date_format, + NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_COMPL_THISYEAR, + gnc_configure_date_completion, + NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_COMPL_SLIDING, + gnc_configure_date_completion, + NULL); + gnc_prefs_remove_cb_by_func (GNC_PREFS_GROUP_GENERAL, + GNC_PREF_DATE_BACKMONTHS, + gnc_configure_date_completion, + NULL); + gnc_prefs_remove_group_cb_by_func (GNC_PREFS_GROUP_GENERAL, + gnc_gui_refresh_all, + NULL); + + gnc_ui_util_remove_registered_prefs (); + gnc_prefs_remove_registered (); + } gnc_extensions_shutdown (); }