diff options
-rw-r--r-- | source/gameengine/Ketsji/KX_NavMeshObject.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/gameengine/Ketsji/KX_NavMeshObject.cpp b/source/gameengine/Ketsji/KX_NavMeshObject.cpp index 24400398f03..bf9c6ddb442 100644 --- a/source/gameengine/Ketsji/KX_NavMeshObject.cpp +++ b/source/gameengine/Ketsji/KX_NavMeshObject.cpp @@ -120,14 +120,14 @@ bool KX_NavMeshObject::BuildVertIndArrays(float *&vertices, int& nverts, int nAllVerts = 0; float *allVerts = NULL; buildNavMeshDataByDerivedMesh(dm, &vertsPerPoly, &nAllVerts, &allVerts, &ndtris, &dtris, - &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, &trisToFacesMap); + &npolys, &dmeshes, &polys, &dtrisToPolysMap, &dtrisToTrisMap, &trisToFacesMap); - MEM_freeN(dtrisToPolysMap); - MEM_freeN(dtrisToTrisMap); - MEM_freeN(trisToFacesMap); + MEM_SAFE_FREE(dtrisToPolysMap); + MEM_SAFE_FREE(dtrisToTrisMap); + MEM_SAFE_FREE(trisToFacesMap); unsigned short *verticesMap = new unsigned short[nAllVerts]; - memset(verticesMap, 0xffff, sizeof(unsigned short)*nAllVerts); + memset(verticesMap, 0xff, sizeof(*verticesMap) * nAllVerts); int curIdx = 0; //vertices - mesh verts //iterate over all polys and create map for their vertices first... |