From c4055d04b4c960b6db02c587f9c87744052294dc Mon Sep 17 00:00:00 2001 From: Ryan Styrczula Date: Tue, 19 May 2020 14:38:10 -0400 Subject: [PATCH] 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. --- code/PostProcessing/FindInvalidDataProcess.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/PostProcessing/FindInvalidDataProcess.cpp b/code/PostProcessing/FindInvalidDataProcess.cpp index 99be52fa4..3ad2446b3 100644 --- a/code/PostProcessing/FindInvalidDataProcess.cpp +++ b/code/PostProcessing/FindInvalidDataProcess.cpp @@ -124,7 +124,7 @@ void FindInvalidDataProcess::Execute(aiScene *pScene) { if (2 == result) { // remove this mesh delete pScene->mMeshes[a]; - AI_DEBUG_INVALIDATE_PTR(pScene->mMeshes[a]); + pScene->mMeshes[a] = NULL; meshMapping[a] = UINT_MAX; continue;