gnucash maint: Bug 797638 - SIGSEGV editing transaction after closing Find Accounts dialog.
John Ralls
jralls at code.gnucash.org
Thu Mar 26 13:15:47 EDT 2020
Updated via https://github.com/Gnucash/gnucash/commit/c3c0d95b (commit)
from https://github.com/Gnucash/gnucash/commit/447de7f6 (commit)
commit c3c0d95bf020159c98d86d8fd29adedb09446a60
Author: John Ralls <jralls at ceridwen.us>
Date: Thu Mar 26 10:09:22 2020 -0700
Bug 797638 - SIGSEGV editing transaction after closing Find Accounts dialog.
Crash was from dangling qof-event handler because the dialog was closed
with the title-bar button instead of the close button.
Since the close button destroys the window, simply moving the other
calls in close_handler to destroy_cb causes the titlebar close button
to behave the same as the close button and prevents the crash.
message for your changes. Lines starting
diff --git a/gnucash/gnome/dialog-find-account.c b/gnucash/gnome/dialog-find-account.c
index c490b7b40..f978cfa9e 100644
--- a/gnucash/gnome/dialog-find-account.c
+++ b/gnucash/gnome/dialog-find-account.c
@@ -77,8 +77,19 @@ gnc_find_account_dialog_window_destroy_cb (GtkWidget *object, gpointer user_data
ENTER(" ");
gnc_unregister_gui_component_by_data (DIALOG_FIND_ACCOUNT_CM_CLASS, facc_dialog);
+ if (facc_dialog->event_handler_id)
+ {
+ qof_event_unregister_handler (facc_dialog->event_handler_id);
+ facc_dialog->event_handler_id = 0;
+ }
+
+ if (facc_dialog->saved_filter_text)
+ g_free (facc_dialog->saved_filter_text);
+
if (facc_dialog->window)
{
+ gnc_save_window_size (GNC_PREFS_GROUP,
+ GTK_WINDOW(facc_dialog->window));
gtk_widget_destroy (facc_dialog->window);
facc_dialog->window = NULL;
}
@@ -463,17 +474,6 @@ close_handler (gpointer user_data)
FindAccountDialog *facc_dialog = user_data;
ENTER(" ");
-
- if (facc_dialog->event_handler_id)
- {
- qof_event_unregister_handler (facc_dialog->event_handler_id);
- facc_dialog->event_handler_id = 0;
- }
-
- if (facc_dialog->saved_filter_text)
- g_free (facc_dialog->saved_filter_text);
-
- gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(facc_dialog->window));
gtk_widget_destroy (GTK_WIDGET(facc_dialog->window));
LEAVE(" ");
}
Summary of changes:
gnucash/gnome/dialog-find-account.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
More information about the gnucash-changes
mailing list