RemoveRedundantMaterials: Set pointer to nullptr after deleting it

pull/1498/head
Turo Lamminen 2017-10-17 19:48:08 +03:00
parent 35907e3446
commit 266e3b29a8
1 changed files with 2 additions and 0 deletions

View File

@ -145,6 +145,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
if (!abReferenced[i]) {
++unreferencedRemoved;
delete pScene->mMaterials[i];
pScene->mMaterials[i] = nullptr;
continue;
}
@ -158,6 +159,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
me = 0;
aiMappingTable[i] = aiMappingTable[a];
delete pScene->mMaterials[i];
pScene->mMaterials[i] = nullptr;
break;
}
}