ObjImporter: Fix possible memory leak

pull/1647/head
Turo Lamminen 2017-12-19 19:38:38 +02:00
parent 47b725a8c8
commit c44522d4db
1 changed files with 6 additions and 2 deletions

View File

@ -264,8 +264,12 @@ aiNode *ObjFileImporter::createNodes(const ObjFile::Model* pModel, const ObjFile
{
unsigned int meshId = pObject->m_Meshes[ i ];
aiMesh *pMesh = createTopology( pModel, pObject, meshId );
if( pMesh && pMesh->mNumFaces > 0 ) {
MeshArray.push_back( pMesh );
if( pMesh ) {
if (pMesh->mNumFaces > 0) {
MeshArray.push_back( pMesh );
} else {
delete pMesh;
}
}
}