Sfoglia il codice sorgente

Fix one byte memory leak.

Malcolm Tyrrell 6 anni fa
parent
commit
3b3e34c36a
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  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();
     }