r17051 - gnucash/branches/2.2/src/gnome-utils - [r17034] Bug#521957: Do not start autosave timer when shutting down book.

Christian Stimming cstim at cvs.gnucash.org
Wed Mar 26 17:04:20 EDT 2008


Author: cstim
Date: 2008-03-26 17:04:19 -0400 (Wed, 26 Mar 2008)
New Revision: 17051
Trac: http://svn.gnucash.org/trac/changeset/17051

Modified:
   gnucash/branches/2.2/src/gnome-utils/gnc-autosave.c
Log:
[r17034] Bug#521957: Do not start autosave timer when shutting down book.


Modified: gnucash/branches/2.2/src/gnome-utils/gnc-autosave.c
===================================================================
--- gnucash/branches/2.2/src/gnome-utils/gnc-autosave.c	2008-03-26 21:04:11 UTC (rev 17050)
+++ gnucash/branches/2.2/src/gnome-utils/gnc-autosave.c	2008-03-26 21:04:19 UTC (rev 17051)
@@ -268,13 +268,17 @@
   g_debug("gnc_main_window_autosave_dirty(dirty = %s)\n",
 	  (dirty ? "TRUE" : "FALSE"));
   if (dirty) {
-    /* Book state changed from non-dirty to dirty. Start the autosave
-       timer. */
-    /* First stop a potentially running old timer. */
-    gnc_autosave_remove_timer(book);
-    /* Add a new timer (timeout) that runs until the next autosave
-       timeout. */
-    gnc_autosave_add_timer(book);
+    /* Book state changed from non-dirty to dirty. */
+    if (!qof_book_shutting_down(book)) {
+      /* Start the autosave timer.
+	 First stop a potentially running old timer. */
+      gnc_autosave_remove_timer(book);
+      /* Add a new timer (timeout) that runs until the next autosave
+	 timeout. */
+      gnc_autosave_add_timer(book);
+    } else {
+      g_debug("Shutting down book, ignoring dirty book");
+    }
   } else {
     /* Book state changed from dirty to non-dirty (probably due to
        saving). Delete the running autosave timer. */



More information about the gnucash-changes mailing list