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:
authorCampbell Barton <ideasman42@gmail.com>2018-04-19 12:12:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-04-19 12:12:57 +0300
commitf2a3579661fd2df9e5e543f7cc7819722dc99fb9 (patch)
tree52a63d2243d1b1f11c8c304eecccfb854d6bd9fc /source/blender/blenkernel/intern/undo_system.c
parenta8db1efbcf1513f7bb912c98ea9c1b7d3b333727 (diff)
Fix bug with NULL context being used in undo
Caused sculpt to crash.
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r--source/blender/blenkernel/intern/undo_system.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index cab675ccd2e..62710240109 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -387,6 +387,9 @@ UndoStep *BKE_undosys_step_push_init(UndoStack *ustack, bContext *C, const char
return BKE_undosys_step_push_init_with_type(ustack, C, name, ut);
}
+/**
+ * \param C: Can be NULL from some callers if their encoding function doesn't need it
+ */
bool BKE_undosys_step_push_with_type(UndoStack *ustack, bContext *C, const char *name, const UndoType *ut)
{
UNDO_NESTED_ASSERT(false);
@@ -395,7 +398,7 @@ bool BKE_undosys_step_push_with_type(UndoStack *ustack, bContext *C, const char
/* Might not be final place for this to be called - probably only want to call it from some
* undo handlers, not all of them? */
- BKE_main_override_static_operations_create(CTX_data_main(C), false);
+ BKE_main_override_static_operations_create(G.main, false);
/* Remove all undos after (also when 'ustack->step_active == NULL'). */
while (ustack->steps.last != ustack->step_active) {