diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-08-06 06:59:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-08-06 07:24:16 +0300 |
commit | bc97d7832906318a1185b3fb460b1d8d89020ba0 (patch) | |
tree | 096969472b2a5ad82c56d8f616cd398f47840bdf /source/blender/editors/interface/interface_handlers.c | |
parent | 99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 (diff) |
Cleanup: use MEM_SAFE_FREE macro
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index d920ebbe11a..6f2232fabe5 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -3438,10 +3438,7 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data) const bool is_num_but = ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER); bool no_zero_strip = false; - if (data->str) { - MEM_freeN(data->str); - data->str = NULL; - } + MEM_SAFE_FREE(data->str); #ifdef USE_DRAG_MULTINUM /* this can happen from multi-drag */ @@ -8635,10 +8632,7 @@ static void button_activate_exit( } /* clean up button */ - if (but->active) { - MEM_freeN(but->active); - but->active = NULL; - } + MEM_SAFE_FREE(but->active); but->flag &= ~(UI_ACTIVE | UI_SELECT); but->flag |= UI_BUT_LAST_ACTIVE; |