OpenGL: Clean up freed and detached shaders a bit more

This commit is contained in:
Jeffrey Pfau 2015-11-22 13:46:10 -08:00
parent f5bc61b852
commit 88e56b5c40
1 changed files with 6 additions and 0 deletions

View File

@ -364,6 +364,7 @@ void GBAGLES2ShaderDetach(struct GBAGLES2Context* context) {
return; return;
} }
context->shaders = 0; context->shaders = 0;
context->nShaders = 0;
} }
static bool _lookupIntValue(const struct Configuration* config, const char* section, const char* key, int* out) { static bool _lookupIntValue(const struct Configuration* config, const char* section, const char* key, int* out) {
@ -814,6 +815,9 @@ void GBAGLES2ShaderFree(struct VideoShader* shader) {
free((void*) shader->name); free((void*) shader->name);
free((void*) shader->author); free((void*) shader->author);
free((void*) shader->description); free((void*) shader->description);
shader->name = 0;
shader->author = 0;
shader->description = 0;
struct GBAGLES2Shader* shaders = shader->passes; struct GBAGLES2Shader* shaders = shader->passes;
size_t n; size_t n;
for (n = 0; n < shader->nPasses; ++n) { for (n = 0; n < shader->nPasses; ++n) {
@ -825,4 +829,6 @@ void GBAGLES2ShaderFree(struct VideoShader* shader) {
} }
} }
free(shaders); free(shaders);
shader->passes = 0;
shader->nPasses = 0;
} }