When the book is shutting down, don't be so eager to destroy the whole

transaction.  This makes it easier to safely iterate over a split list.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13471 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Chris Shoemaker
2006-03-04 06:56:27 +00:00
parent 8090e0ee3c
commit 9a65cc1cc6

View File

@@ -917,7 +917,6 @@ void xaccDisableDataScrubbing(void) { scrub_data = 0; }
/* Check for an implicitly deleted transaction */
static gboolean was_trans_emptied(Transaction *trans)
{
if (qof_book_shutting_down(xaccTransGetBook(trans))) return TRUE;
FOR_EACH_SPLIT(trans, return FALSE);
return TRUE;
}
@@ -1017,8 +1016,8 @@ xaccTransCommitEdit (Transaction *trans)
* can cause pointers to splits and transactions to disapear out
* from under the holder.
*/
if (!(trans->inst.do_free) && scrub_data)
{
if (!(trans->inst.do_free) && scrub_data &&
!qof_book_shutting_down(xaccTransGetBook(trans))) {
/* The total value of the transaction should sum to zero.
* Call the trans scrub routine to fix it. Indirectly, this
* routine also performs a number of other transaction fixes too.