fix memory leak with navmesh

This commit is contained in:
Campbell Barton 2013-11-02 04:22:08 +00:00
parent df1f21d678
commit 59cdb0d65d
1 changed files with 3 additions and 1 deletions

View File

@ -126,7 +126,7 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
MEM_SAFE_FREE(dtrisToTrisMap);
MEM_SAFE_FREE(trisToFacesMap);
unsigned short *verticesMap = new unsigned short[nAllVerts];
unsigned short *verticesMap = (unsigned short *)MEM_mallocN(sizeof(*verticesMap) * nAllVerts, __func__);
memset(verticesMap, 0xff, sizeof(*verticesMap) * nAllVerts);
int curIdx = 0;
//vertices - mesh verts
@ -215,6 +215,8 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts,
}
MEM_SAFE_FREE(allVerts);
MEM_freeN(verticesMap);
}
else
{