2.5
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index c74497fa10ba799f4b48393251e75fd5c985680c..1f5ed78ba5832dd83a7c8cc9156bee7d0aacda38 100644 (file)
@@ -310,9 +310,11 @@ int WM_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event)
 
                if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
                        wm_operator_register(C->wm, op);
 
                if((retval & OPERATOR_FINISHED) && (ot->flag & OPTYPE_REGISTER)) {
                        wm_operator_register(C->wm, op);
+                       handler->op= NULL;
                }
                else if(!(retval & OPERATOR_RUNNING_MODAL)) {
                        wm_operator_free(op);
                }
                else if(!(retval & OPERATOR_RUNNING_MODAL)) {
                        wm_operator_free(op);
+                       handler->op= NULL;
                }
        }
 
                }
        }
 
@@ -400,6 +402,7 @@ static int wm_handler_operator_call(bContext *C, ListBase *handlers, wmEventHand
                                handler->op= NULL;
                        }
                        
                                handler->op= NULL;
                        }
                        
+                       
                        /* remove modal handler, operator itself should have been cancelled and freed */
                        if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
                                BLI_remlink(handlers, handler);
                        /* remove modal handler, operator itself should have been cancelled and freed */
                        if(retval & (OPERATOR_CANCELLED|OPERATOR_FINISHED)) {
                                BLI_remlink(handlers, handler);