Skip to content

Commit

Permalink
Leak fix: delete GLSL shader objects if we fail to compile.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Mar 24, 2013
1 parent 0ca0465 commit 869418a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mojoshader_opengl.c
Expand Up @@ -402,6 +402,7 @@ static int impl_GLSL_CompileShader(const MOJOSHADER_parseData *pd, GLuint *s)
GLsizei len = 0;
ctx->glGetInfoLogARB(shader, sizeof (error_buffer), &len,
(GLchar *) error_buffer);
ctx->glDeleteShader(shader);
*s = 0;
return 0;
} // if
Expand All @@ -421,6 +422,7 @@ static int impl_GLSL_CompileShader(const MOJOSHADER_parseData *pd, GLuint *s)
GLsizei len = 0;
ctx->glGetInfoLogARB(shader, sizeof (error_buffer), &len,
(GLcharARB *) error_buffer);
ctx->glDeleteObjectARB(shader);
*s = 0;
return 0;
} // if
Expand Down

0 comments on commit 869418a

Please sign in to comment.