public void EndLevelLoad()
{
int c = _guiList.Count;
for(int i = 0; i < c; i++)
{
if(_guiList[i].ReferenceCount == 0)
{
// common->Printf( "purging %s.\n", guis[i]->GetSourceFile() );
// use this to make sure no materials still reference this gui
bool remove = true;
for(int j = 0; j < idE.DeclManager.GetDeclCount(DeclType.Material); j++)
{
idMaterial material = (idMaterial) idE.DeclManager.DeclByIndex(DeclType.Material, j, false);
if(material.GlobalInterface == _guiList[i])
{
remove = false;
break;
}
}
if(remove == true)
{
_guiList[i].Dispose();
_guiList.RemoveAt(i);
i--;
c--;
}
}
}
}