diff options
author | Pablo Dobarro <pablodp606> | 2021-02-03 22:54:30 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2021-02-03 22:55:17 +0300 |
commit | 7bde2844ae8fcf5547edc495a0518cfdad49ffff (patch) | |
tree | 8e037ad5e528b4002e1e57fcf98d5e8196579860 /source/blender/blenkernel | |
parent | 5eb5a7f4b7d7c5228ec9596b35e7f2e317aad97d (diff) |
Fix memory leak in boundary brush preview data
The edge preview data of the boundary needs to be freed with the
boundary data created for the brush. Also, all data for the
ScultpSession preview that is used to render the cursor needs to be
freed with the ##SculptSession##.
Found by Jacques Lucke
Reviewed By: JacquesLucke
Differential Revision: https://developer.blender.org/D10173
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/paint.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c index 4eecf3a3a87..7c65f118cf4 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1487,6 +1487,14 @@ void BKE_sculptsession_free(Object *ob) MEM_SAFE_FREE(ss->pose_ik_chain_preview); } + if (ss->boundary_preview) { + MEM_SAFE_FREE(ss->boundary_preview->vertices); + MEM_SAFE_FREE(ss->boundary_preview->edges); + MEM_SAFE_FREE(ss->boundary_preview->distance); + MEM_SAFE_FREE(ss->boundary_preview->edit_info); + MEM_SAFE_FREE(ss->boundary_preview); + } + BKE_sculptsession_free_vwpaint_data(ob->sculpt); MEM_freeN(ss); |