Sfoglia il codice sorgente

Fix double free caused in FindInvalidDataProcess

In debug builds, there's no issues, but in release, an invalid mesh that
is deleted in FindInvalidDataProcess will be double free'd when the
parent scene is destroyed.
Ryan Styrczula 5 anni fa
parent
commit
c4055d04b4
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      code/PostProcessing/FindInvalidDataProcess.cpp

+ 1 - 1
code/PostProcessing/FindInvalidDataProcess.cpp

@@ -124,7 +124,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) {
         if (2 == result) {
         if (2 == result) {
             // remove this mesh
             // remove this mesh
             delete pScene->mMeshes[a];
             delete pScene->mMeshes[a];
-            AI_DEBUG_INVALIDATE_PTR(pScene->mMeshes[a]);
+            pScene->mMeshes[a] = NULL;
 
 
             meshMapping[a] = UINT_MAX;
             meshMapping[a] = UINT_MAX;
             continue;
             continue;