closes code/Collada/ColladaLoader.cpp: fix possible memleak when throwing an exception.

pull/2535/head
Kim Kulling 2019-07-09 19:44:56 +02:00
parent ed0cd2f775
commit ed6dbf9533
1 changed files with 3 additions and 2 deletions

View File

@ -612,7 +612,8 @@ aiMesh *ColladaLoader::findMesh(std::string meshid)
aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::Mesh* pSrcMesh, const Collada::SubMesh& pSubMesh,
const Collada::Controller* pSrcController, size_t pStartVertex, size_t pStartFace)
{
aiMesh* dstMesh = new aiMesh;
std::unique_ptr<aiMesh> dstMesh(new aiMesh);
//aiMesh* dstMesh = new aiMesh;
dstMesh->mName = pSrcMesh->mName;
@ -898,7 +899,7 @@ aiMesh* ColladaLoader::CreateMesh( const ColladaParser& pParser, const Collada::
}
}
return dstMesh;
return dstMesh.release();
}
// ------------------------------------------------------------------------------------------------