opengl-tutorials icon indicating copy to clipboard operation
opengl-tutorials copied to clipboard

Shaders are not deleted after calling glDeleteShader.

Open SandNoodle opened this issue 3 years ago • 1 comments

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.

SandNoodle avatar May 10 '22 21:05 SandNoodle

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.

YourAverageFTCPerson avatar Jan 27 '24 17:01 YourAverageFTCPerson