diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index 2c11e4d5bb6..167e0f4b522 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -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);