diff --git a/code/RemoveRedundantMaterials.cpp b/code/RemoveRedundantMaterials.cpp index 398fea4b0..2285d06b4 100644 --- a/code/RemoveRedundantMaterials.cpp +++ b/code/RemoveRedundantMaterials.cpp @@ -142,6 +142,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene) // if the material is not referenced ... remove it if (!abReferenced[i]) { ++unreferenced; + delete pScene->mMaterials[i]; continue; }