Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Dobarro <pablodp606@gmail.com>2020-01-10 20:05:57 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-01-14 22:21:45 +0300
commit22f5edcf45e82b06ac70abfc542ae35169178506 (patch)
tree7794c7aafb2e5d93574c57d25401c61fb029bee4 /source/blender/blenkernel
parenteb9401e9aff86dcaf0a1120260c974d5f489104a (diff)
Fix T71712: Free the dynamic mesh preview when rebuilding the PBVH
The PBVH usually is rebuild after a topology change, so it does not make sense to keep the previous dynamic mesh preview vertex list. This may cause a crash is the number of vertices of the new mesh (and preview) is larger previous one. Now the list is deleted with the PBVH and a new one will be generated using the new mesh when the cursor is updated. Reviewed By: jbakker Maniphest Tasks: T71712 Differential Revision: https://developer.blender.org/D6476
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/paint.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index a334a088e0f..46c2f735761 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1019,15 +1019,12 @@ static void sculptsession_free_pbvh(Object *object)
ss->pbvh = NULL;
}
- if (ss->pmap) {
- MEM_freeN(ss->pmap);
- ss->pmap = NULL;
- }
+ MEM_SAFE_FREE(ss->pmap);
- if (ss->pmap_mem) {
- MEM_freeN(ss->pmap_mem);
- ss->pmap_mem = NULL;
- }
+ MEM_SAFE_FREE(ss->pmap_mem);
+
+ MEM_SAFE_FREE(ss->preview_vert_index_list);
+ ss->preview_vert_index_count = 0;
}
void BKE_sculptsession_bm_to_me_for_render(Object *object)