Merge pull request #1035 from bpay/memfixes

Memfixes
This commit is contained in:
Luis Anton Rebollo 2015-01-25 13:42:32 +01:00
commit 6492028bb2
26 changed files with 79 additions and 52 deletions

View file

@ -263,8 +263,6 @@ void MaterialList::clearMatInstList()
if (mMatInstList[i])
{
BaseMatInstance* current = mMatInstList[i];
delete current;
mMatInstList[i] = NULL;
// ok, since ts material lists can remap difference indexes to the same object
// we need to make sure that we don't delete the same memory twice. walk the
@ -272,6 +270,9 @@ void MaterialList::clearMatInstList()
for (U32 j=0; j<mMatInstList.size(); j++)
if (mMatInstList[j] == current)
mMatInstList[j] = NULL;
mMatInstList[i] = NULL;
delete current;
}
}
}