[Gnucash-changes] r13471 - gnucash/trunk/src/engine - When the book is shutting down, don't be so eager to destroy the whole

Chris Shoemaker chris at cvs.gnucash.org
Sat Mar 4 01:56:28 EST 2006


Author: chris
Date: 2006-03-04 01:56:27 -0500 (Sat, 04 Mar 2006)
New Revision: 13471
Trac: http://svn.gnucash.org/trac/changeset/13471

Modified:
   gnucash/trunk/src/engine/Transaction.c
Log:
   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.


Modified: gnucash/trunk/src/engine/Transaction.c
===================================================================
--- gnucash/trunk/src/engine/Transaction.c	2006-03-04 06:49:23 UTC (rev 13470)
+++ gnucash/trunk/src/engine/Transaction.c	2006-03-04 06:56:27 UTC (rev 13471)
@@ -917,7 +917,6 @@
 /* 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 @@
     * 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.



More information about the gnucash-changes mailing list