diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/render/textures.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/render/textures.cc b/src/render/textures.cc index 687d245..ab490a6 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -98,7 +98,8 @@ void Textures::unload(const std::string &name) if (it != registry.end()) { con_debug << " unloading " << (*it).first << std::endl; size_t id = (*it).second; - if (textures[id]) { + // do not unload texture id 0, 'unkown texture' + if (id && textures[id]) { glDeleteTextures(1, &textures[id]); textures[id] = 0; texture_size[id].clear(); @@ -114,7 +115,8 @@ void Textures::unload(const size_t id) if ((*it).second == id) { con_debug << " unloading " << (*it).first << std::endl; size_t id = (*it).second; - if (textures[id]) { + // do not unload texture id 0, 'unkown texture' + if (id && textures[id]) { glDeleteTextures(1, &textures[id]); textures[id] = 0; } |