RemoveRedundantMaterials: Set pointer to nullptr after deleting it
parent
35907e3446
commit
266e3b29a8
|
@ -145,6 +145,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||||
if (!abReferenced[i]) {
|
if (!abReferenced[i]) {
|
||||||
++unreferencedRemoved;
|
++unreferencedRemoved;
|
||||||
delete pScene->mMaterials[i];
|
delete pScene->mMaterials[i];
|
||||||
|
pScene->mMaterials[i] = nullptr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,6 +159,7 @@ void RemoveRedundantMatsProcess::Execute( aiScene* pScene)
|
||||||
me = 0;
|
me = 0;
|
||||||
aiMappingTable[i] = aiMappingTable[a];
|
aiMappingTable[i] = aiMappingTable[a];
|
||||||
delete pScene->mMaterials[i];
|
delete pScene->mMaterials[i];
|
||||||
|
pScene->mMaterials[i] = nullptr;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue