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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-25 00:01:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-25 00:01:45 +0400
commit4b3976cc5a26937724823d07fdcdeb317a4c3948 (patch)
treea5ef7b8e4959f9b18b66d75f2644ab531d6afcd5 /source/blender/blenlib/intern/pbvh.c
parent45a3acc39838e3ab998b33d4d10e134a7927cd8a (diff)
parentd0b7fb5fdf90f09748f94a21e205be7f31ebbb25 (diff)
svn merge ^/trunk/blender -r42116:42139
Diffstat (limited to 'source/blender/blenlib/intern/pbvh.c')
-rw-r--r--source/blender/blenlib/intern/pbvh.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c
index ecf8fc706b9..ae0becc840b 100644
--- a/source/blender/blenlib/intern/pbvh.c
+++ b/source/blender/blenlib/intern/pbvh.c
@@ -656,12 +656,17 @@ void BLI_pbvh_free(PBVH *bvh)
/* if pbvh was deformed, new memory was allocated for verts/faces -- free it */
MEM_freeN(bvh->verts);
- MEM_freeN(bvh->faces);
+ if(bvh->faces)
+ MEM_freeN(bvh->faces);
}
}
- MEM_freeN(bvh->nodes);
- MEM_freeN(bvh->prim_indices);
+ if(bvh->nodes)
+ MEM_freeN(bvh->nodes);
+
+ if(bvh->prim_indices)
+ MEM_freeN(bvh->prim_indices);
+
MEM_freeN(bvh);
}
@@ -1127,6 +1132,9 @@ void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3])
PBVHNode **nodes;
int totnode;
+ if(!bvh->nodes)
+ return;
+
BLI_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag),
&nodes, &totnode);