All pastes #261628 Raw Edit

Mine

public text v1 · immutable
#261628 ·published 2006-11-29 18:46 UTC
rendered paste body
Index: qofsession.c
===================================================================
--- qofsession.c        (revision 15110)
+++ qofsession.c        (working copy)
@@ -1193,7 +1193,9 @@
        int err;
        gint num;
        char *msg, *book_id;
-
+        static int lock = 0;
+
+        if (!lock) return;
        if (!session) return;
        ENTER ("sess=%p book_id=%s",
                 session, session->book_id ? session->book_id : "(null)");
@@ -1299,6 +1301,7 @@
        be = session->backend;
        if (be)
        {
+            lock++;
                for (node = session->books; node; node=node->next)
                {
                        abook = node->data;
@@ -1311,6 +1314,7 @@
                                if (save_error_handler(be, session)) return;
                        }
                }
+            lock--;
                /* If we got to here, then the backend saved everything
                * just fine, and we are done. So return. */
                /* Return the book_id to previous value. */