Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/undo_system.c
| Show First 20 Lines • Show All 445 Lines • ▼ Show 20 Lines | |||||
| /** \} */ | /** \} */ | ||||
| UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, | UndoStep *BKE_undosys_step_push_init_with_type(UndoStack *ustack, | ||||
| bContext *C, | bContext *C, | ||||
| const char *name, | const char *name, | ||||
| const UndoType *ut) | const UndoType *ut) | ||||
| { | { | ||||
| UNDO_NESTED_ASSERT(false); | UNDO_NESTED_ASSERT(false); | ||||
| if (ustack->step_init) { | |||||
| undosys_step_free_and_unlink(ustack, ustack->step_init); | |||||
| ustack->step_init = NULL; | |||||
| } | |||||
| /* We could detect and clean this up (but it should never happen!). */ | /* We could detect and clean this up (but it should never happen!). */ | ||||
| BLI_assert(ustack->step_init == NULL); | BLI_assert(ustack->step_init == NULL); | ||||
| if (ut->step_encode_init) { | if (ut->step_encode_init) { | ||||
| undosys_stack_validate(ustack, false); | undosys_stack_validate(ustack, false); | ||||
| if (ustack->step_active) { | if (ustack->step_active) { | ||||
| undosys_stack_clear_all_last(ustack, ustack->step_active->next); | undosys_stack_clear_all_last(ustack, ustack->step_active->next); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 426 Lines • Show Last 20 Lines | |||||