[Bf-blender-cvs] [f2a3579661f] blender2.8: Fix bug with NULL context being used in undo

Campbell Barton noreply at git.blender.org
Thu Apr 19 11:13:38 CEST 2018


Commit: f2a3579661fd2df9e5e543f7cc7819722dc99fb9
Author: Campbell Barton
Date:   Thu Apr 19 11:12:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBf2a3579661fd2df9e5e543f7cc7819722dc99fb9

Fix bug with NULL context being used in undo

Caused sculpt to crash.

===================================================================

M	source/blender/blenkernel/intern/undo_system.c

===================================================================

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) {



More information about the Bf-blender-cvs mailing list