forked from bartvdbraak/blender
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.
This commit is contained in:
parent
f2acb10b6b
commit
f320c5ae9e
@ -911,7 +911,7 @@ static void make_edges_mdata(MVert *UNUSED(allvert), MFace *allface, MLoop *alll
|
|||||||
MPoly *mpoly;
|
MPoly *mpoly;
|
||||||
MFace *mface;
|
MFace *mface;
|
||||||
MEdge *medge, *med;
|
MEdge *medge, *med;
|
||||||
EdgeHash *hash = BLI_edgehash_new(__func__);
|
EdgeHash *hash;
|
||||||
struct EdgeSort *edsort, *ed;
|
struct EdgeSort *edsort, *ed;
|
||||||
int a, totedge = 0;
|
int a, totedge = 0;
|
||||||
unsigned int totedge_final = 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);
|
MEM_freeN(edsort);
|
||||||
|
|
||||||
/* set edge members of mloops */
|
/* 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++) {
|
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));
|
BLI_edgehash_insert(hash, med->v1, med->v2, SET_UINT_IN_POINTER(edge_index));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user