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/uvedit | |
parent | 99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 (diff) |
Cleanup: use MEM_SAFE_FREE macro
Diffstat (limited to 'source/blender/editors/uvedit')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_parametrizer.c | 5 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 25 |
2 files changed, 6 insertions, 24 deletions
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index f97403a0919..b4bdeace716 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -3399,10 +3399,7 @@ static void p_chart_lscm_end(PChart *chart) EIG_linear_solver_delete(chart->u.lscm.context); } - if (chart->u.lscm.abf_alpha) { - MEM_freeN(chart->u.lscm.abf_alpha); - chart->u.lscm.abf_alpha = NULL; - } + MEM_SAFE_FREE(chart->u.lscm.abf_alpha); chart->u.lscm.context = NULL; chart->u.lscm.pin1 = NULL; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 1bcd1fad9d6..c5485cc1495 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -265,26 +265,11 @@ static StitchPreviewer *stitch_preview_init(void) static void stitch_preview_delete(StitchPreviewer *stitch_preview) { if (stitch_preview) { - if (stitch_preview->preview_polys) { - MEM_freeN(stitch_preview->preview_polys); - stitch_preview->preview_polys = NULL; - } - if (stitch_preview->uvs_per_polygon) { - MEM_freeN(stitch_preview->uvs_per_polygon); - stitch_preview->uvs_per_polygon = NULL; - } - if (stitch_preview->preview_stitchable) { - MEM_freeN(stitch_preview->preview_stitchable); - stitch_preview->preview_stitchable = NULL; - } - if (stitch_preview->preview_unstitchable) { - MEM_freeN(stitch_preview->preview_unstitchable); - stitch_preview->preview_unstitchable = NULL; - } - if (stitch_preview->static_tris) { - MEM_freeN(stitch_preview->static_tris); - stitch_preview->static_tris = NULL; - } + MEM_SAFE_FREE(stitch_preview->preview_polys); + MEM_SAFE_FREE(stitch_preview->uvs_per_polygon); + MEM_SAFE_FREE(stitch_preview->preview_stitchable); + MEM_SAFE_FREE(stitch_preview->preview_unstitchable); + MEM_SAFE_FREE(stitch_preview->static_tris); MEM_freeN(stitch_preview); } } |