diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-29 03:45:35 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-09-29 17:22:09 +0300 |
commit | 0fd3723b95b243938a4ba71da8a769aa4ebb1a20 (patch) | |
tree | 8cde29869c7b8ea9869c6769319dfd25824ee916 /source/blender/blenkernel/intern/pbvh.c | |
parent | 0ffb96f701176fe5b3eb03bd90414ed7fd4502cf (diff) |
Fix small memory leaks in some sculpt tools
Also use MEM_SAFE_FREE to simplify code.
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh.c')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index c920b80d818..7bbf1068aa7 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1302,9 +1302,7 @@ void BKE_pbvh_update_bounds(PBVH *bvh, int flag) pbvh_flush_bb(bvh, bvh->nodes, flag); } - if (nodes) { - MEM_freeN(nodes); - } + MEM_SAFE_FREE(nodes); } void BKE_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3]) @@ -2278,9 +2276,7 @@ void BKE_pbvh_update_normals(PBVH *bvh, struct SubdivCCG *subdiv_ccg) } } - if (nodes) { - MEM_freeN(nodes); - } + MEM_SAFE_FREE(nodes); } /** @@ -2323,9 +2319,7 @@ void BKE_pbvh_draw_cb(PBVH *bvh, pbvh_update_draw_buffers(bvh, nodes, totnode, show_vcol, update_flag); } - if (nodes) { - MEM_freeN(nodes); - } + MEM_SAFE_FREE(nodes); } /* Gather visible nodes. */ @@ -2353,9 +2347,7 @@ void BKE_pbvh_draw_cb(PBVH *bvh, } } - if (nodes) { - MEM_freeN(nodes); - } + MEM_SAFE_FREE(nodes); } void BKE_pbvh_draw_debug_cb( |