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/blenkernel/intern/dynamicpaint.c | |
parent | 99738fbfdc8b4639d95c796bcc8711bd89c1aaa4 (diff) |
Cleanup: use MEM_SAFE_FREE macro
Diffstat (limited to 'source/blender/blenkernel/intern/dynamicpaint.c')
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index 52996e3bcc7..8f94c407cae 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -844,10 +844,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface) if (temp_s_num) { MEM_freeN(temp_s_num); } - if (temp_t_index) { - MEM_freeN(temp_t_index); - } - grid->temp_t_index = NULL; + MEM_SAFE_FREE(temp_t_index); if (error || !grid->s_num) { setError(surface->canvas, N_("Not enough free memory")); @@ -988,10 +985,7 @@ void dynamicPaint_freeSurface(const DynamicPaintModifierData *pmd, DynamicPaintS } surface->pointcache = NULL; - if (surface->effector_weights) { - MEM_freeN(surface->effector_weights); - } - surface->effector_weights = NULL; + MEM_SAFE_FREE(surface->effector_weights); BLI_remlink(&(surface->canvas->surfaces), surface); dynamicPaint_freeSurfaceData(surface); |