GRIM/EMI: Add nullptr checks to avoid segfaults on cleanup

This commit is contained in:
Christian Krause 2015-01-13 20:37:02 +01:00
parent b832fd43c1
commit 789da551fc
3 changed files with 10 additions and 6 deletions

View file

@ -1218,9 +1218,10 @@ void GfxOpenGLS::selectTexture(const Texture *texture) {
void GfxOpenGLS::destroyTexture(Texture *texture) {
GLuint *textures = static_cast<GLuint *>(texture->_texture);
glDeleteTextures(1, textures);
delete[] textures;
if (textures) {
glDeleteTextures(1, textures);
delete[] textures;
}
}
void GfxOpenGLS::createBitmap(BitmapData *bitmap) {