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.
This commit is contained in:
Geert Janssens 2014-12-06 13:52:36 +01:00
parent a6d7184d83
commit f4481f7dcf

View File

@ -348,6 +348,7 @@ void
gnc_payment_window_fill_docs_list (PaymentWindow *pw) gnc_payment_window_fill_docs_list (PaymentWindow *pw)
{ {
GtkListStore *store; GtkListStore *store;
GtkTreeSelection *selection;
GList *list = NULL, *node; GList *list = NULL, *node;
g_return_if_fail (pw->docs_list_tree_view && GTK_IS_TREE_VIEW(pw->docs_list_tree_view)); 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); &pw->owner, NULL);
/* Clear the existing list */ /* 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))); store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pw->docs_list_tree_view)));
gtk_list_store_clear(store); gtk_list_store_clear(store);