mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
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:e6506b3cd2("mesa: retain gl_shader_programs after glDeleteProgram if they are in use") Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> (cherry picked from commit6c61c31dc2)
This commit is contained in:
parent
42fa7cf2bb
commit
1939affe51
1 changed files with 3 additions and 0 deletions
|
|
@ -159,6 +159,9 @@ _mesa_free_shader_state(struct gl_context *ctx)
|
|||
{
|
||||
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||
_mesa_reference_program(ctx, &ctx->Shader.CurrentProgram[i], NULL);
|
||||
_mesa_reference_shader_program(ctx,
|
||||
&ctx->Shader.ReferencedPrograms[i],
|
||||
NULL);
|
||||
}
|
||||
_mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue