diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-03-14 21:16:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-03-14 21:37:42 +0300 |
commit | f13c729b26befae8709a8e565a27d6fd31101d44 (patch) | |
tree | 7aed7706549dfb9431b3eb2ce68ab0d637882950 /source/blender/editors | |
parent | 647fb6ef1ed36488b1ae13570b7385367e7346c9 (diff) |
WM: free operators when repeating
Needed since the active operator isn't ensured to be the last.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/util/undo.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 1c17f8c12ff..d88c36a8e24 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2903,7 +2903,8 @@ static void SCREEN_OT_spacedata_cleanup(wmOperatorType *ot) static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) { - wmOperator *lastop = CTX_wm_manager(C)->operators.last; + wmWindowManager *wm = CTX_wm_manager(C); + wmOperator *lastop = wm->operators.last; /* Seek last registered operator */ while (lastop) { @@ -2916,6 +2917,7 @@ static int repeat_last_exec(bContext *C, wmOperator *UNUSED(op)) } if (lastop) { + WM_operator_free_all_after(wm, lastop); WM_operator_repeat(C, lastop); } diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index fab5b7e821f..4e021d4833e 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -419,6 +419,9 @@ int ED_undo_operator_repeat(bContext *C, struct wmOperator *op) if (G.debug & G_DEBUG) printf("redo_cb: operator redo %s\n", op->type->name); + + WM_operator_free_all_after(wm, op); + ED_undo_pop_op(C, op); if (op->type->check) { |