gnucash stable: Bug 798948 - XML file corrupted by saving twice in extremely short period

John Ralls jralls at code.gnucash.org
Mon Jun 12 20:05:17 EDT 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/38118a2a (commit)
	from  https://github.com/Gnucash/gnucash/commit/75fb523c (commit)



commit 38118a2ad6e595c92ff19cb7e2cd355f340a70f1
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jun 12 17:00:45 2023 -0700

    Bug 798948 - XML file corrupted by saving twice in extremely short period
    
    Prevent reentrance with gnc_file_save_in_progress().

diff --git a/gnucash/gnome/gnc-plugin-basic-commands.c b/gnucash/gnome/gnc-plugin-basic-commands.c
index 07e70f5ace..64d451ab08 100644
--- a/gnucash/gnome/gnc-plugin-basic-commands.c
+++ b/gnucash/gnome/gnc-plugin-basic-commands.c
@@ -381,7 +381,8 @@ gnc_main_window_cmd_file_save (GSimpleAction *simple,
 
     g_return_if_fail (data != NULL);
 
-    if (!gnc_main_window_all_finish_pending ())
+    if (!gnc_main_window_all_finish_pending () ||
+        gnc_file_save_in_progress())
         return;
 
     gnc_window_set_progressbar_window (GNC_WINDOW(data->window));
@@ -398,7 +399,8 @@ gnc_main_window_cmd_file_save_as (GSimpleAction *simple,
 
     g_return_if_fail (data != NULL);
 
-    if (!gnc_main_window_all_finish_pending ())
+    if (!gnc_main_window_all_finish_pending () ||
+        gnc_file_save_in_progress())
         return;
 
     gnc_window_set_progressbar_window (GNC_WINDOW(data->window));



Summary of changes:
 gnucash/gnome/gnc-plugin-basic-commands.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)



More information about the gnucash-changes mailing list