Fix another round of squirrel coverity issues
[supertux.git] / src / video / texture.hpp
index ca0b68c..76964a9 100644 (file)
@@ -53,12 +53,12 @@ private:
 
 public:
   Texture() : cache_filename() {}
-  virtual ~Texture() 
+  virtual ~Texture()
   {
-    if (texture_manager && cache_filename != "")
+    if (TextureManager::current() && cache_filename != "")
       /* The cache entry is now useless: its weak pointer to us has been
        * cleared.  Remove the entry altogether to save memory. */
-      texture_manager->reap_cache_entry(cache_filename);
+      TextureManager::current()->reap_cache_entry(cache_filename);
   }
 
   virtual unsigned int get_texture_width() const = 0;