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.
This commit is contained in:
Jacques Lucke
2024-09-11 14:37:58 +02:00
parent 76700680d0
commit e18aa65973
2 changed files with 5 additions and 2 deletions

View File

@@ -104,7 +104,9 @@ MemFileUndoData *BKE_memfile_undo_encode(Main *bmain, MemFileUndoData *mfu_prev)
{
MemFileUndoData *mfu = MEM_cnew<MemFileUndoData>(__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 */

View File

@@ -474,7 +474,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);