diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-14 13:30:14 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-14 13:30:14 +0300 |
commit | 2e9b92b5ccac07f63c1b535cfb25e013e01a141b (patch) | |
tree | 741e8724dc82065c788e84f15be5f0fe94e6f7f2 /source/blender/blenkernel | |
parent | 332846b188d6c7463758fb8d8659785beccde63a (diff) |
Fix T54568: Undo memory de-duplication failed
Error in 651b8fb14e caused de-duplication to fail.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_undo_system.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/undo_system.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_undo_system.h b/source/blender/blenkernel/BKE_undo_system.h index 9697c7dd8e2..53ea8ddefe8 100644 --- a/source/blender/blenkernel/BKE_undo_system.h +++ b/source/blender/blenkernel/BKE_undo_system.h @@ -149,6 +149,7 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, struct bContext *C, cons bool BKE_undosys_step_push(UndoStack *ustack, struct bContext *C, const char *name); UndoStep *BKE_undosys_step_find_by_name_with_type(UndoStack *ustack, const char *name, const UndoType *ut); +UndoStep *BKE_undosys_step_find_by_type(UndoStack *ustack, const UndoType *ut); UndoStep *BKE_undosys_step_find_by_name(UndoStack *ustack, const char *name); bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack, struct bContext *C, UndoStep *us, bool use_skip); diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 760c6a60976..5a0081bff16 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -500,6 +500,16 @@ UndoStep *BKE_undosys_step_find_by_name(UndoStack *ustack, const char *name) return BLI_rfindstring(&ustack->steps, name, offsetof(UndoStep, name)); } +UndoStep *BKE_undosys_step_find_by_type(UndoStack *ustack, const UndoType *ut) +{ + for (UndoStep *us = ustack->steps.last; us; us = us->prev) { + if (us->type == ut) { + return us; + } + } + return NULL; +} + bool BKE_undosys_step_undo_with_data_ex( UndoStack *ustack, bContext *C, UndoStep *us, bool use_skip) |