Fix crash in texture cleanup branch

This commit is contained in:
auria.mg 2016-12-26 23:03:22 -05:00
parent 943373ea8e
commit 0be858f7f8

View File

@ -387,9 +387,11 @@ void MaterialManager::makeMaterialsPermanent()
void MaterialManager::unloadAllTextures()
{
std::string texture_folder = file_manager->getAssetDirectory(FileManager::TEXTURE);
for (int i = 0; i < m_shared_material_index; i++)
{
m_materials[i]->unloadTexture();
if (m_materials[i]->getTexFullPath().find(texture_folder) != std::string::npos)
m_materials[i]->unloadTexture();
}
}