[Bf-blender-cvs] [bf10989] wiggly-widgets: Update widgets attached to modal OP before handler might be freed

Julian Eisel noreply at git.blender.org
Tue Sep 8 22:59:55 CEST 2015


Commit: bf10989da09c3851d0f8dc5e87b7f20e0bb4d3a2
Author: Julian Eisel
Date:   Tue Sep 8 22:55:26 2015 +0200
Branches: wiggly-widgets
https://developer.blender.org/rBbf10989da09c3851d0f8dc5e87b7f20e0bb4d3a2

Update widgets attached to modal OP before handler might be freed

Some people were experiencing crashes with transform manipulator handling, this should fix it (although I'm not sure why it worked fine for me).

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

M	source/blender/windowmanager/intern/wm_event_system.c

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

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 2554b7a..f81fed0 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -1697,6 +1697,9 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
 					CTX_wm_region_set(C, NULL);
 				}
 
+				/* update widgets during modal handlers */
+				wm_widget_handler_modal_update(C, event, handler);
+
 				/* remove modal handler, operator itself should have been canceled and freed */
 				if (retval & (OPERATOR_CANCELLED | OPERATOR_FINISHED)) {
 					WM_cursor_grab_disable(CTX_wm_window(C), NULL);
@@ -2133,9 +2136,6 @@ static int wm_handlers_do_intern(bContext *C, wmEvent *event, ListBase *handlers
 			else {
 				/* modal, swallows all */
 				action |= wm_handler_operator_call(C, handlers, handler, event, NULL);
-
-				/* update widgets during modal handlers */
-				wm_widget_handler_modal_update(C, event, handler);
 			}
 
 			if (action & WM_HANDLER_BREAK) {




More information about the Bf-blender-cvs mailing list