From c5ef38a415805d4d4609eb44a85cc0417b2fa7d5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 1 Feb 2010 11:36:22 +0000 Subject: Fix #20420: grab brush + subsurf modifier crash. Previously the PBVH nodes were cached once at the start, but these can change when modifiers are executed, now it simply doesn't cache them anymore, that was only really a performance bottleneck when it was caching individual vertices. --- source/blender/blenlib/intern/pbvh.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/pbvh.c b/source/blender/blenlib/intern/pbvh.c index 0133017eb4d..9bc04201419 100644 --- a/source/blender/blenlib/intern/pbvh.c +++ b/source/blender/blenlib/intern/pbvh.c @@ -346,6 +346,8 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node) GET_INT_FROM_POINTER(BLI_ghashIterator_getKey(iter)); } + BLI_ghashIterator_free(iter); + for(i = 0; i < totface*4; ++i) if(node->face_vert_indices[i] < 0) node->face_vert_indices[i]= -node->face_vert_indices[i] + node->uniq_verts - 1; @@ -1006,6 +1008,8 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot BLI_ghashIterator_step(hiter), ++i) faces[i]= BLI_ghashIterator_getKey(hiter); + BLI_ghashIterator_free(hiter); + BLI_ghash_free(map, NULL, NULL); *totface= tot; -- cgit v1.2.3