X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvideo%2Ftexture_manager.cpp;h=174343bd5279c8e5d2e3c8290dc52f72dc4a3c2f;hb=67690e081c28b818e94796be284206326bc8a6b9;hp=237aff3efeb200182c875c5ca810fb4876b5709b;hpb=551c54f2ea0a4ef991a24e66e70635ed8c41fb10;p=supertux.git diff --git a/src/video/texture_manager.cpp b/src/video/texture_manager.cpp index 237aff3ef..174343bd5 100644 --- a/src/video/texture_manager.cpp +++ b/src/video/texture_manager.cpp @@ -14,6 +14,7 @@ #include "image_texture.hpp" #include "glutil.hpp" #include "file_system.hpp" +#include "msg.hpp" TextureManager* texture_manager = NULL; @@ -27,9 +28,7 @@ TextureManager::~TextureManager() i != image_textures.end(); ++i) { if(i->second == NULL) continue; -#ifdef DEBUG - std::cerr << "Warning: Texture '" << i->first << "' not freed\n"; -#endif + msg_warning << "Texture '" << i->first << "' not freed" << std::endl; delete i->second; } } @@ -55,7 +54,7 @@ TextureManager::get(const std::string& _filename) void TextureManager::release(ImageTexture* texture) { - image_textures[texture->filename] = NULL; + image_textures.erase(texture->filename); delete texture; }