gnucash stable: Bug 799429 - Crash when changing accounting period end date

John Ralls jralls at code.gnucash.org
Tue Oct 8 19:49:09 EDT 2024


Updated	 via  https://github.com/Gnucash/gnucash/commit/fef0124e (commit)
	from  https://github.com/Gnucash/gnucash/commit/c63d2dcf (commit)



commit fef0124e45e0ec7ee053d858714acd2a0c317f83
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Oct 8 16:44:32 2024 -0700

    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.

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)));
 



Summary of changes:
 gnucash/gnome/gnc-plugin-page-account-tree.cpp | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)



More information about the gnucash-changes mailing list