From fef0124e45e0ec7ee053d858714acd2a0c317f83 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 8 Oct 2024 16:44:32 -0700 Subject: [PATCH] Bug 799429 - Crash when changing accounting period end date Remove the accounting period changed callbacks at GncPluginPage destruction so that the destroyed page isn't called in the new session. --- gnucash/gnome/gnc-plugin-page-account-tree.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gnucash/gnome/gnc-plugin-page-account-tree.cpp b/gnucash/gnome/gnc-plugin-page-account-tree.cpp index b138072a00..1321b9b30e 100644 --- a/gnucash/gnome/gnc-plugin-page-account-tree.cpp +++ b/gnucash/gnome/gnc-plugin-page-account-tree.cpp @@ -754,7 +754,20 @@ gnc_plugin_page_account_tree_destroy_widget (GncPluginPage *plugin_page) (gpointer)gnc_plugin_page_account_tree_summarybar_position_changed, page); - // Save account filter state information to account section + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_CHOICE_ABS, + (gpointer)accounting_period_changed_cb, page); + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_DATE, + (gpointer)accounting_period_changed_cb, page); + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_START_PERIOD, + (gpointer)accounting_period_changed_cb, page); + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_CHOICE_ABS, + (gpointer)accounting_period_changed_cb, page); + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_DATE, + (gpointer)accounting_period_changed_cb, page); + gnc_prefs_remove_cb_by_func(GNC_PREFS_GROUP_ACCT_SUMMARY, GNC_PREF_END_PERIOD, + (gpointer)accounting_period_changed_cb, page); + +// Save account filter state information to account section gnc_tree_view_account_save_filter (GNC_TREE_VIEW_ACCOUNT(priv->tree_view), &priv->fd, gnc_state_get_current(), gnc_tree_view_get_state_section (GNC_TREE_VIEW(priv->tree_view)));