A couple more sanity checking tweaks for texture freeing.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -67,6 +67,7 @@ protected:
|
||||
#else
|
||||
glDeleteTexturesEXT(1, &texture_id);
|
||||
#endif
|
||||
texture_id = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user