Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2021-01-06 14:25:35 +0300
committerBastien Montagne <bastien@blender.org>2021-01-06 14:28:06 +0300
commitbc3e38ca3a4228b7191e9fec39288c9f37ec53b1 (patch)
tree6a770e2087fd0a36017db3dc0b13dfae0abc3617 /source/blender/blenkernel/intern/undo_system.c
parent4e23f08807bb0ccd361932f335768f645572d6bf (diff)
Cleanup/refactor: UndoType: Clarify `use_context` variable.
Rename it to mark it is only for `encode` callbacks, fix `encode` callback of text undo to early fail in case it gets a NULL context, add an assert to `BKE_undosys_step_push_with_type` that context is not NULL when undotype requires a valid one. Note that in practice this should not change anything, currently it seems that we always get a valid context in `BKE_undosys_step_push_with_type`?
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r--source/blender/blenkernel/intern/undo_system.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 078c93532d9..0713a2d6729 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -501,6 +501,8 @@ UndoPushReturn BKE_undosys_step_push_with_type(UndoStack *ustack,
const char *name,
const UndoType *ut)
{
+ BLI_assert(ut->use_context_for_encode == false || C != NULL);
+
UNDO_NESTED_ASSERT(false);
undosys_stack_validate(ustack, false);
bool is_not_empty = ustack->step_active != NULL;