From 03397d42e2dc5fb29d4fc374086daebfe38be21a Mon Sep 17 00:00:00 2001 From: Turo Lamminen Date: Tue, 23 Aug 2022 14:15:06 +0300 Subject: [PATCH] Use unique_ptr for aaiFaces instead of explicit delete[] --- code/AssetLib/SMD/SMDLoader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/AssetLib/SMD/SMDLoader.cpp b/code/AssetLib/SMD/SMDLoader.cpp index 1a860568a..2a43aab09 100644 --- a/code/AssetLib/SMD/SMDLoader.cpp +++ b/code/AssetLib/SMD/SMDLoader.cpp @@ -231,7 +231,7 @@ void SMDImporter::CreateOutputMeshes() { pScene->mMeshes = new aiMesh*[pScene->mNumMeshes]; typedef std::vector FaceList; - FaceList* aaiFaces = new FaceList[pScene->mNumMeshes]; + std::unique_ptr aaiFaces(new FaceList[pScene->mNumMeshes]); // approximate the space that will be required unsigned int iNum = (unsigned int)asTriangles.size() / pScene->mNumMeshes; @@ -392,7 +392,6 @@ void SMDImporter::CreateOutputMeshes() { } delete[] aaiBones; } - delete[] aaiFaces; } // ------------------------------------------------------------------------------------------------