Opengl: need to delete Shader, not Program

Fixes an error that is reported by various opengl debugging tools
This commit is contained in:
Scott Mansell 2021-02-27 19:28:39 +13:00
parent bb7fb68531
commit 0151d72140

View File

@ -251,13 +251,12 @@ Shader::create(const char **vsrc, const char **fsrc)
} }
fail = linkprogram(vs, fs, &program); fail = linkprogram(vs, fs, &program);
glDeleteShader(vs);
glDeleteShader(fs);
if(fail){ if(fail){
glDeleteShader(fs);
glDeleteShader(vs);
return nil; return nil;
} }
glDeleteProgram(vs);
glDeleteProgram(fs);
Shader *sh = rwNewT(Shader, 1, MEMDUR_EVENT | ID_DRIVER); // or global? Shader *sh = rwNewT(Shader, 1, MEMDUR_EVENT | ID_DRIVER); // or global?