]> git.mxchange.org Git - simgear.git/commitdiff
A couple more sanity checking tweaks for texture freeing.
authorcurt <curt>
Wed, 9 Jul 2003 20:58:39 +0000 (20:58 +0000)
committercurt <curt>
Wed, 9 Jul 2003 20:58:39 +0000 (20:58 +0000)
simgear/screen/texture.cxx
simgear/screen/texture.hxx

index 62e8c74b11f9d6f35bfff2a823bcd068a3d848db..338fd113a818c17dfd8454fadd2807478dcbad4c 100644 (file)
@@ -35,11 +35,13 @@ SGTexture::SGTexture(unsigned int width, unsigned int height)
 
 SGTexture::~SGTexture()
 {
-    if (texture_data)
+    if ( texture_data ) {
         delete texture_data;
+    }
 
-    if (texture_id)
+    if ( texture_id >= 0 ) {
         free_id();
+    }
 }
 
 void
index 71609c5093d16ce7c9348e80e1273b65a50c7cd8..083c6036d47f57861e569c3b95f7b4f78feadf3b 100644 (file)
@@ -67,6 +67,7 @@ protected:
 #else
         glDeleteTexturesEXT(1, &texture_id);
 #endif
+        texture_id = -1;
     }