소스 검색

Fix one byte memory leak.

Malcolm Tyrrell 6 년 전
부모
커밋
3b3e34c36a
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      code/glTF/glTFImporter.cpp

+ 2 - 0
code/glTF/glTFImporter.cpp

@@ -170,6 +170,8 @@ void glTFImporter::ImportMaterials(glTF::Asset& r) {
 
     if (mScene->mNumMaterials == 0) {
         mScene->mNumMaterials = 1;
+        // Delete the array of length zero created above.
+        delete[] mScene->mMaterials;
         mScene->mMaterials = new aiMaterial*[1];
         mScene->mMaterials[0] = new aiMaterial();
     }