Commit 1e0e8cb5 authored by Christian Forfang's avatar Christian Forfang

Added glDeleteShader to stop shader_load(...) from leaking shaders.

parent da1dc67a
......@@ -98,6 +98,7 @@ shader_load( const char * vert_filename,
char *vert_source = shader_read( vert_filename );
GLuint vert_shader = shader_compile( vert_source, GL_VERTEX_SHADER);
glAttachShader( handle, vert_shader);
glDeleteShader( vert_shader );
free( vert_source );
}
if( frag_filename && strlen( frag_filename ) )
......@@ -105,6 +106,7 @@ shader_load( const char * vert_filename,
char *frag_source = shader_read( frag_filename );
GLuint frag_shader = shader_compile( frag_source, GL_FRAGMENT_SHADER);
glAttachShader( handle, frag_shader);
glDeleteShader( frag_shader );
free( frag_source );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment