Messaging subsystem rewrite, step I
[supertux.git] / src / video / texture_manager.cpp
index 237aff3..174343b 100644 (file)
@@ -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;
 }