A couple more sanity checking tweaks for texture freeing.

This commit is contained in:
curt
2003-07-09 20:58:39 +00:00
parent d4c0c8940b
commit db1966c156
2 changed files with 5 additions and 2 deletions

View 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

View File

@@ -67,6 +67,7 @@ protected:
#else
glDeleteTexturesEXT(1, &texture_id);
#endif
texture_id = -1;
}