diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 17:13:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-24 17:13:29 +0400 |
commit | f320c5ae9e9177bbf5732bd4f39dac2574af7318 (patch) | |
tree | d20088579fd0d25159b2e2b3f5d207ecf6fec403 | |
parent | f2acb10b6b160b9ab85591d4717e27be800a0568 (diff) |
fix for leak in make_edges_mdata() if there were no edges to create,
also reserve the total number of edges in the hash when its created.
-rw-r--r-- | source/blender/blenkernel/intern/mesh.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index 6170e989407..64c79713796 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -911,7 +911,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll MPoly *mpoly; MFace *mface; MEdge *medge, *med; - EdgeHash *hash = BLI_edgehash_new(__func__); + EdgeHash *hash; struct EdgeSort *edsort, *ed; int a, totedge = 0; unsigned int totedge_final = 0; @@ -988,6 +988,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll MEM_freeN(edsort); /* set edge members of mloops */ + hash = BLI_edgehash_new_ex(__func__, totedge_final); for (edge_index = 0, med = medge; edge_index < totedge_final; edge_index++, med++) { BLI_edgehash_insert(hash, med->v1, med->v2, SET_UINT_IN_POINTER(edge_index)); } |