Use unique_ptr for aaiFaces instead of explicit delete[]

pull/4699/head
Turo Lamminen 2022-08-23 14:15:06 +03:00
parent 795c0abcc8
commit 03397d42e2
1 changed files with 1 additions and 2 deletions

View File

@ -231,7 +231,7 @@ void SMDImporter::CreateOutputMeshes() {
pScene->mMeshes = new aiMesh*[pScene->mNumMeshes];
typedef std::vector<unsigned int> FaceList;
FaceList* aaiFaces = new FaceList[pScene->mNumMeshes];
std::unique_ptr<FaceList[]> 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;
}
// ------------------------------------------------------------------------------------------------