From 2b252bb9a54fb14f6417c56f248abb808f24c457 Mon Sep 17 00:00:00 2001 From: bzt Date: Mon, 18 Nov 2019 06:23:41 +0100 Subject: [PATCH] My mistake, fixed --- code/M3D/M3DImporter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/M3D/M3DImporter.cpp b/code/M3D/M3DImporter.cpp index 0156950c3..9371e2228 100644 --- a/code/M3D/M3DImporter.cpp +++ b/code/M3D/M3DImporter.cpp @@ -396,9 +396,14 @@ void M3DImporter::importMeshes() // we must switch mesh if material changes if(lastMat != m3d->face[i].materialid) { lastMat = m3d->face[i].materialid; - if(pMesh && vertices->size() && faces->size()) { + if(pMesh && vertices && vertices->size() && faces && faces->size()) { populateMesh(pMesh, faces, vertices, normals, texcoords, colors, vertexids); meshes->push_back(pMesh); + delete faces; + delete vertices; + delete normals; + delete texcoords; + delete colors; delete vertexids; // this is not stored in pMesh, just to collect bone vertices } pMesh = new aiMesh;