summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYevhenii Kolesnikov <[email protected]>2019-07-11 13:00:46 +0300
committerJuan A. Suarez Romero <[email protected]>2019-07-25 08:34:56 +0000
commit4bb56fdd460732d62232bc5131531d64bd1b5733 (patch)
treef9bcf18fc132ed9771f8628f84105d7caacfbe59 /src
parent61117d653e3401dc3165cdfb8140b97848efa1d4 (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]> (cherry picked from commit 882fe09a74b4438cb3093ed0cd6d9525f30c3f84)
Diffstat (limited to 'src')
-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 6b73e6c7e7a..9564664daa3 100644
--- a/src/mesa/main/shaderapi.c
+++ b/src/mesa/main/shaderapi.c
@@ -162,6 +162,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);