From f4481f7dcfbde5643c64851a950a8dad683c4176 Mon Sep 17 00:00:00 2001 From: Geert Janssens Date: Sat, 6 Dec 2014 13:52:36 +0100 Subject: [PATCH] Bug 740471 - Applying payment to invoice Segmentation fault Clear selection before emptying list store to prevent the code from running calculations on a changing list. --- src/business/business-gnome/dialog-payment.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c index 5cc09e50eb..3767f37579 100644 --- a/src/business/business-gnome/dialog-payment.c +++ b/src/business/business-gnome/dialog-payment.c @@ -348,6 +348,7 @@ void gnc_payment_window_fill_docs_list (PaymentWindow *pw) { GtkListStore *store; + GtkTreeSelection *selection; GList *list = NULL, *node; g_return_if_fail (pw->docs_list_tree_view && GTK_IS_TREE_VIEW(pw->docs_list_tree_view)); @@ -358,6 +359,8 @@ gnc_payment_window_fill_docs_list (PaymentWindow *pw) &pw->owner, NULL); /* Clear the existing list */ + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(pw->docs_list_tree_view)); + gtk_tree_selection_unselect_all (selection); store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pw->docs_list_tree_view))); gtk_list_store_clear(store);