From 7ddf9aa4e8d5bb01d28c168c7b90cac403334d06 Mon Sep 17 00:00:00 2001 From: Derek Atkins Date: Tue, 25 Jun 2002 14:13:50 +0000 Subject: [PATCH] Force recomputation of lots' is_closed flag when splits are added or removed. Otherwise it's possible to return a false-negative cached response. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7022 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/engine/gnc-lot.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/engine/gnc-lot.c b/src/engine/gnc-lot.c index 131d6f3177..6931af4ca8 100644 --- a/src/engine/gnc-lot.c +++ b/src/engine/gnc-lot.c @@ -234,6 +234,9 @@ gnc_lot_add_split (GNCLot *lot, Split *split) split->lot = lot; lot->splits = g_list_append (lot->splits, split); + + /* for recomputation of is-closed */ + lot->is_closed = -1; } void @@ -244,11 +247,11 @@ gnc_lot_remove_split (GNCLot *lot, Split *split) ENTER ("(lot=%p, split=%p)", lot, split); lot->splits = g_list_remove (lot->splits, split); split->lot = NULL; + lot->is_closed = -1; /* force an is-closed computation */ if (NULL == lot->splits) { lot->account = NULL; - lot->is_closed = FALSE; } }