Merge pull request #67 from phire/delete_the_right_thing

Opengl: need to delete Shader, not Program
This commit is contained in:
aap 2021-02-27 09:34:25 +01:00 committed by GitHub
commit 81ed9cb75e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 4 deletions

View File

@ -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?