From 6f672295a553be20631cd4d4046fbc98a49a4411 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Wed, 11 Sep 2024 14:37:58 +0200 Subject: [PATCH] Fix: quit.blend is not saved as recovery file This was broken in efb511a76d. The memfile-undo step always had this flag set, but the non-memfile file-write did not. --- source/blender/blenkernel/intern/blender_undo.cc | 4 +++- source/blender/windowmanager/intern/wm_init_exit.cc | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/source/blender/blenkernel/intern/blender_undo.cc b/source/blender/blenkernel/intern/blender_undo.cc index 59c15140b16..430fb7cc137 100644 --- a/source/blender/blenkernel/intern/blender_undo.cc +++ b/source/blender/blenkernel/intern/blender_undo.cc @@ -104,7 +104,9 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev) { MemFileUndoData *mfu = MEM_cnew(__func__); - /* Include recovery information since undo-data is written out as #BLENDER_QUIT_FILE. */ + /* This flag used to be set because the undo step was written as #BLENDER_QUIT_FILE. It's not + * clear whether there are still good reasons to keep it. Undo can also be thought of as a kind + * of recovery, so better keep it for now. */ const int fileflags = G.fileflags | G_FILE_RECOVER_WRITE; /* disk save version */ diff --git a/source/blender/windowmanager/intern/wm_init_exit.cc b/source/blender/windowmanager/intern/wm_init_exit.cc index 134fd9c2abb..f42c9ed4e1c 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.cc +++ b/source/blender/windowmanager/intern/wm_init_exit.cc @@ -476,7 +476,8 @@ void WM_exit_ex(bContext *C, const bool do_python_exit, const bool do_user_exit_ /* Save quit.blend. */ Main *bmain = CTX_data_main(C); char filepath[FILE_MAX]; - const int fileflags = G.fileflags & ~G_FILE_COMPRESS; + int fileflags = G.fileflags & ~G_FILE_COMPRESS; + fileflags |= G_FILE_RECOVER_WRITE; BLI_path_join(filepath, sizeof(filepath), BKE_tempdir_base(), BLENDER_QUIT_FILE);