diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-25 00:01:45 +0400 |
commit | 4b3976cc5a26937724823d07fdcdeb317a4c3948 (patch) | |
tree | a5ef7b8e4959f9b18b66d75f2644ab531d6afcd5 /source/blender/blenlib/intern/pbvh.c | |
parent | 45a3acc39838e3ab998b33d4d10e134a7927cd8a (diff) | |
parent | d0b7fb5fdf90f09748f94a21e205be7f31ebbb25 (diff) |
svn merge ^/trunk/blender -r42116:42139
Diffstat (limited to 'source/blender/blenlib/intern/pbvh.c')
-rw-r--r-- | source/blender/blenlib/intern/pbvh.c | 14 |
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); |