From 65ffeaa81e10efcd49b1fe0d29ffe8ca51bbf8da Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 19 Dec 2017 18:24:03 +0200 Subject: [PATCH] ObjImporter: Use unique_ptr --- code/ObjFileImporter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ObjFileImporter.cpp b/code/ObjFileImporter.cpp index 9f3bdef97..5fa57e108 100644 --- a/code/ObjFileImporter.cpp +++ b/code/ObjFileImporter.cpp @@ -317,7 +317,7 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj return NULL; } - aiMesh* pMesh = new aiMesh; + std::unique_ptr pMesh(new aiMesh); if( !pObjMesh->m_name.empty() ) { pMesh->mName.Set( pObjMesh->m_name ); } @@ -382,9 +382,9 @@ aiMesh *ObjFileImporter::createTopology( const ObjFile::Model* pModel, const Obj } // Create mesh vertices - createVertexArray(pModel, pData, meshIndex, pMesh, uiIdxCount); + createVertexArray(pModel, pData, meshIndex, pMesh.get(), uiIdxCount); - return pMesh; + return pMesh.release(); } // ------------------------------------------------------------------------------------------------