From 0be858f7f88c6015e9825fd030df7a6cb7b91808 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Mon, 26 Dec 2016 23:03:22 -0500 Subject: [PATCH] Fix crash in texture cleanup branch --- src/graphics/material_manager.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphics/material_manager.cpp b/src/graphics/material_manager.cpp index dfb3db7f8..3b3cac772 100644 --- a/src/graphics/material_manager.cpp +++ b/src/graphics/material_manager.cpp @@ -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(); } }