diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-11-29 09:01:03 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-11-29 09:01:03 +0400 |
commit | 285e09bceb4d78cdefb046b5c58f8fa33a04ef05 (patch) | |
tree | adb4bfa7074144c593bf01159bb0a8eafd972a09 /source/blender/windowmanager/intern/wm_operators.c | |
parent | fd88ce4d731e59d8880e32a84af153ee6d251cca (diff) |
Fix T37149: Macros store settings from a cancelled operation
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a4c389d82ea..5d2edcecfba 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -296,6 +296,11 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event) retval = opm->type->modal(C, opm, event); OPERATOR_RETVAL_CHECK(retval); + /* if we're halfway through using a tool and cancel it, clear the options [#37149] */ + if (retval & OPERATOR_CANCELLED) { + WM_operator_properties_clear(opm->ptr); + } + /* if this one is done but it's not the last operator in the macro */ if ((retval & OPERATOR_FINISHED) && opm->next) { MacroData *md = op->customdata; @@ -918,6 +923,15 @@ void WM_operator_properties_reset(wmOperator *op) } } +void WM_operator_properties_clear(PointerRNA *ptr) +{ + IDProperty *properties = ptr->data; + + if (properties) { + IDP_ClearProperty(properties); + } +} + void WM_operator_properties_free(PointerRNA *ptr) { IDProperty *properties = ptr->data; |