Fix for Debug GL generating errors when changing graphics preferences (reloading shaders).

master
Dave Parks 2012-02-08 19:01:08 -06:00
parent d10bcca167
commit e0582d4bc7
1 changed files with 4 additions and 1 deletions

View File

@ -109,7 +109,10 @@ void LLGLSLShader::unload()
glGetAttachedObjectsARB(mProgramObject, 1024, &count, obj);
for (GLsizei i = 0; i < count; i++)
{
glDeleteObjectARB(obj[i]);
if (glIsProgramARB(obj[i]))
{
glDeleteObjectARB(obj[i]);
}
}
glDeleteObjectARB(mProgramObject);