gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Sat Dec 20 05:30:08 EST 2014
Updated via https://github.com/Gnucash/gnucash/commit/2ef335d9 (commit)
via https://github.com/Gnucash/gnucash/commit/f4481f7d (commit)
via https://github.com/Gnucash/gnucash/commit/a6d7184d (commit)
from https://github.com/Gnucash/gnucash/commit/efc8544f (commit)
commit 2ef335d9c70f41927d10c3379b39802096994f5e
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Sat Dec 6 13:53:34 2014 +0100
Bug 740471 - Applying payment to invoice Segmentation fault
Stop listening for gui update events while on the way out
(after the ok button was pressed).
diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c
index 3767f37..298cb69 100644
--- a/src/business/business-gnome/dialog-payment.c
+++ b/src/business/business-gnome/dialog-payment.c
@@ -649,6 +649,17 @@ gnc_payment_ok_cb (GtkWidget *widget, gpointer data)
* and amount so we can proceed with the payment.
* Note: make sure it's called before all entry points to this function !
*/
+
+ /* We're on our way out, stop watching for object changes that could
+ * trigger a gui refresh. Without this the gui suspend/resume
+ * pair could still trigger a gui update on the payment dialog
+ * before we close it. This is undesired because the lots may be in
+ * an inconsistent state until after all events are handled. So
+ * the gui refresh may result in a crash.
+ * See https://bugzilla.gnome.org/show_bug.cgi?id=740471
+ */
+ gnc_gui_component_clear_watches (pw->component_id);
+
gnc_suspend_gui_refresh ();
{
const char *memo, *num;
commit f4481f7dcfbde5643c64851a950a8dad683c4176
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Sat Dec 6 13:52:36 2014 +0100
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.
diff --git a/src/business/business-gnome/dialog-payment.c b/src/business/business-gnome/dialog-payment.c
index 5cc09e5..3767f37 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);
commit a6d7184d830d8a8bc0c339d012ac17c249a40994
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Sat Dec 6 13:21:00 2014 +0100
Bug 740471 - Applying payment to invoice Segmentation fault
Attempt to fix it by no longer nullifying lots during processing
diff --git a/src/engine/gncOwner.c b/src/engine/gncOwner.c
index 25fa682..70f41db 100644
--- a/src/engine/gncOwner.c
+++ b/src/engine/gncOwner.c
@@ -1232,12 +1232,11 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots)
* Note that due to the iterative nature of this function lots
* in the list may become empty/closed before they are evaluated as
* base lot, so we should check this for each lot. */
- if (!left_lot)
+ if (!left_lot || qof_instance_get_destroying (left_lot))
continue;
if (gnc_lot_count_splits (left_lot) == 0)
{
gnc_lot_destroy (left_lot);
- left_iter->data = NULL;
continue;
}
if (gnc_lot_is_closed (left_lot))
@@ -1263,12 +1262,11 @@ void gncOwnerAutoApplyPaymentsWithLots (const GncOwner *owner, GList *lots)
* Note that due to the iterative nature of this function lots
* in the list may become empty/closed before they are evaluated as
* base lot, so we should check this for each lot. */
- if (!right_lot)
+ if (!right_lot || qof_instance_get_destroying (right_lot))
continue;
if (gnc_lot_count_splits (right_lot) == 0)
{
gnc_lot_destroy (right_lot);
- right_iter->data = NULL;
continue;
}
if (gnc_lot_is_closed (right_lot))
Summary of changes:
src/business/business-gnome/dialog-payment.c | 14 ++++++++++++++
src/engine/gncOwner.c | 6 ++----
2 files changed, 16 insertions(+), 4 deletions(-)
More information about the gnucash-changes
mailing list