diff options
Diffstat (limited to 'source/blender/blenkernel/intern/blender_undo.c')
-rw-r--r-- | source/blender/blenkernel/intern/blender_undo.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c index d826aaf24e3..9f8a30722c2 100644 --- a/source/blender/blenkernel/intern/blender_undo.c +++ b/source/blender/blenkernel/intern/blender_undo.c @@ -77,7 +77,12 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu, G.fileflags |= G_FILE_NO_UI; if (UNDO_DISK) { - success = BKE_blendfile_read(C, mfu->filename, &(const struct BlendFileReadParams){0}, NULL); + const struct BlendFileReadParams params = {0}; + struct BlendFileData *bfd = BKE_blendfile_read(mfu->filename, ¶ms, NULL); + if (bfd != NULL) { + BKE_blendfile_read_setup(C, bfd, ¶ms, NULL); + success = true; + } } else { struct BlendFileReadParams params = {0}; @@ -85,7 +90,12 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu, if (!use_old_bmain_data) { params.skip_flags |= BLO_READ_SKIP_UNDO_OLD_MAIN; } - success = BKE_blendfile_read_from_memfile(C, &mfu->memfile, ¶ms, NULL); + struct BlendFileData *bfd = BKE_blendfile_read_from_memfile( + bmain, &mfu->memfile, ¶ms, NULL); + if (bfd != NULL) { + BKE_blendfile_read_setup(C, bfd, ¶ms, NULL); + success = true; + } } /* Restore, bmain has been re-allocated. */ |