summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/shaderapi.c
diff options
context:
space:
mode:
authorYevhenii Kolesnikov <[email protected]>2019-07-11 13:00:46 +0300
committerKenneth Graunke <[email protected]>2019-07-24 16:54:21 +0000
commit882fe09a74b4438cb3093ed0cd6d9525f30c3f84 (patch)
tree9d8f6cd84d0fa4f514ad12f9e8d089e6fcb02f41 /src/mesa/main/shaderapi.c
parentfa2fc68de132317ce63d407cef34e266c1d3e838 (diff)
main: Fix memleaks in mesa_use_program
Add freeing of SubroutineIndexes to the _mesa_free_shader_state. Fixes: 4566aaaa5b1 ("mesa/subroutines: start adding per-context subroutine index support (v1.1)") Signed-off-by: Yevhenii Kolesnikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/main/shaderapi.c')
-rw-r--r--src/mesa/main/shaderapi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
index c057178bfa9..99eb2dc00e2 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -164,6 +164,8 @@ _mesa_free_shader_state(struct gl_context *ctx)
_mesa_reference_shader_program(ctx,
&ctx->Shader.ReferencedPrograms[i],
NULL);
+ free(ctx->SubroutineIndex[i].IndexPtr);
+ ctx->SubroutineIndex[i].IndexPtr = NULL;
}
_mesa_reference_shader_program(ctx, &ctx->Shader.ActiveProgram, NULL);