diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-15 20:43:22 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-15 20:43:22 +0300 |
commit | 9285bbe48430f2bf3534bc23a35b95d94bc2674c (patch) | |
tree | 4f20cf8fb5428ca4e7316e398e676f066b80cdd1 /source | |
parent | 3c64696972572cffdc02441a2039c914923796e8 (diff) |
Fix error splitting convex faces
Created double faces, leaked memory.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/bmesh/operators/bmo_connect_concave.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/bmesh/operators/bmo_connect_concave.c b/source/blender/bmesh/operators/bmo_connect_concave.c index 34f59aad4f1..8b9c60ada52 100644 --- a/source/blender/bmesh/operators/bmo_connect_concave.c +++ b/source/blender/bmesh/operators/bmo_connect_concave.c @@ -85,7 +85,7 @@ static bool bm_face_split_by_concave( BMFace **faces_array = BLI_array_alloca(faces_array, faces_array_tot); BMEdge **edges_array = BLI_array_alloca(edges_array, edges_array_tot); const int quad_method = 0, ngon_method = 0; /* beauty */ - LinkNode *r_faces_double = NULL; + LinkNode *faces_double = NULL; float normal[3]; BLI_assert(f_base->len > 3); @@ -96,7 +96,7 @@ static bool bm_face_split_by_concave( bm, f_base, faces_array, &faces_array_tot, edges_array, &edges_array_tot, - &r_faces_double, + &faces_double, quad_method, ngon_method, false, pf_arena, pf_heap, pf_ehash); @@ -163,6 +163,13 @@ static bool bm_face_split_by_concave( BLI_heap_clear(pf_heap, NULL); BLI_edgehash_clear_ex(pf_ehash, NULL, BLI_POLYFILL_ALLOC_NGON_RESERVE); + while (faces_double) { + LinkNode *next = faces_double->next; + BM_face_kill(bm, faces_double->link); + MEM_freeN(faces_double); + faces_double = next; + } + return true; } |