diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-10-28 17:47:51 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-10-28 17:47:51 +0300 |
commit | ee4fb233618c0842e216042f442fbbc4d000b0bb (patch) | |
tree | d6279f128855cf84d55f117cbfd55e76ca7b4eab /source/blender/windowmanager/intern/wm_operators.c | |
parent | cb7afe5e419c1219ec3e96c580225d4603089167 (diff) |
WM: clear operator memory on file load
Was causing problems when opening scenes with different scale set.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 77f6028dd06..154249a2294 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -494,6 +494,27 @@ bool WM_operatortype_remove(const char *idname) return true; } +/** + * Remove memory of all previously executed tools. + */ +void WM_operatortype_last_properties_clear_all(void) +{ + GHashIterator iter; + + for (WM_operatortype_iter(&iter); + (!BLI_ghashIterator_done(&iter)); + (BLI_ghashIterator_step(&iter))) + { + wmOperatorType *ot = BLI_ghashIterator_getValue(&iter); + + if (ot->last_properties) { + IDP_FreeProperty(ot->last_properties); + MEM_freeN(ot->last_properties); + ot->last_properties = NULL; + } + } +} + /* SOME_OT_op -> some.op */ void WM_operator_py_idname(char *to, const char *from) { |