2
0
Эх сурвалжийг харах

Fix one byte memory leak.

Malcolm Tyrrell 6 жил өмнө
parent
commit
3b3e34c36a

+ 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();
     }