From 2e9b92b5ccac07f63c1b535cfb25e013e01a141b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 14 Apr 2018 12:30:14 +0200 Subject: Fix T54568: Undo memory de-duplication failed Error in 651b8fb14e caused de-duplication to fail. --- source/blender/editors/undo/memfile_undo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/undo/memfile_undo.c') diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c index a0f7ebac477..bb81da74f88 100644 --- a/source/blender/editors/undo/memfile_undo.c +++ b/source/blender/editors/undo/memfile_undo.c @@ -70,9 +70,10 @@ static bool memfile_undosys_step_encode(struct bContext *C, UndoStep *us_p) /* Important we only use 'main' from the context (see: BKE_undosys_stack_init_from_main). */ struct Main *bmain = CTX_data_main(C); + UndoStack *ustack = ED_undo_stack_get(); /* can be NULL, use when set. */ - MemFileUndoStep *us_prev = (MemFileUndoStep *)BKE_undosys_step_same_type_prev(us_p); + MemFileUndoStep *us_prev = (MemFileUndoStep *)BKE_undosys_step_find_by_type(ustack, BKE_UNDOSYS_TYPE_MEMFILE); us->data = BKE_memfile_undo_encode(bmain, us_prev ? us_prev->data : NULL); us->step.data_size = us->data->undo_size; return true; -- cgit v1.2.3