opengl-tutorials
opengl-tutorials copied to clipboard
Shaders are not deleted after calling glDeleteShader.
Due to OpenGL specification glDetachShader has to be called at some point before or after glDeleteShader.
If shader has already been flagged for deletion by a call to glDeleteShader and it is not attached to any other program object, it will be deleted after it has been detached.
As far as I've checked, this bug is included in every example containing shader code.
Correct me if I'm wrong, but glDetachShader is the opposite of glAttachShader and the only reason why he "deletes" the shaders is because they're already attached.