From 0151d72140a04f1a7e42819b7649f4c035c84ad0 Mon Sep 17 00:00:00 2001 From: Scott Mansell Date: Sat, 27 Feb 2021 19:28:39 +1300 Subject: [PATCH] Opengl: need to delete Shader, not Program Fixes an error that is reported by various opengl debugging tools --- src/gl/gl3shader.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gl/gl3shader.cpp b/src/gl/gl3shader.cpp index 7614171..a98ef50 100644 --- a/src/gl/gl3shader.cpp +++ b/src/gl/gl3shader.cpp @@ -251,13 +251,12 @@ Shader::create(const char **vsrc, const char **fsrc) } fail = linkprogram(vs, fs, &program); + + glDeleteShader(vs); + glDeleteShader(fs); if(fail){ - glDeleteShader(fs); - glDeleteShader(vs); return nil; } - glDeleteProgram(vs); - glDeleteProgram(fs); Shader *sh = rwNewT(Shader, 1, MEMDUR_EVENT | ID_DRIVER); // or global?