gl: Don't call glDeleteObjectARB on null objects

glDeleteObjectARB will flag GL_INVALID_PARAMETER when it's called with a
null parameter. Avoid this so the error list doesn't get tainted.
issue1247
Nicolas Hake 2015-02-16 17:43:44 +01:00
parent cac94659d0
commit 50a81a8dc7
1 changed files with 3 additions and 1 deletions

View File

@ -121,7 +121,9 @@ void C4LandscapeRenderGL::Clear()
}
for (i = 0; i < C4LR_MipMapCount; i++)
{
glDeleteObjectARB(hMaterialTexture[i]);
// Unlike delete, glDeleteObject doesn't like a 0 parameter
if (hMaterialTexture[i] != 0)
glDeleteObjectARB(hMaterialTexture[i]);
hMaterialTexture[i] = 0;
}
}