mesa: do not leak ctx->Shader.ReferencedProgram references
authorJose Dapena Paz <jose.dapena@lge.com>
Thu, 24 May 2018 17:56:24 +0000 (19:56 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Fri, 25 May 2018 00:38:09 +0000 (10:38 +1000)
commit6c61c31dc2fe52ad8a56ebe0b3aa10c223b635ba
treeb45ef7b12302c72e5b1d40e02e1ed0b5744a39f2
parent508b423dd6f08591a911f83e7a798027ab0021c0
mesa: do not leak ctx->Shader.ReferencedProgram references

When glUseProgram is used, references to the included shaders are
added in ctx->Shader.ReferencedProgram. But those references are not
decreased when the shader data is deallocated. Thus, those shaders
are leaked.

Explicitely remove the pending references to these shaders.

Fixes: e6506b3cd23 ("mesa: retain gl_shader_programs after glDeleteProgram if they are in use")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/mesa/main/shaderapi.c