mesa: free current ComputeProgram state in _mesa_free_context_data
authorTapani Pälli <tapani.palli@intel.com>
Wed, 20 Sep 2017 06:29:16 +0000 (09:29 +0300)
committerTapani Pälli <tapani.palli@intel.com>
Thu, 21 Sep 2017 05:10:51 +0000 (08:10 +0300)
This is already done for other programs stages, fixes a leak when using
compute programs.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102844
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/main/context.c

index dad3ab39f848f1f705e324aa8077a995f1aecfe4..55a65ac2abe06bc99ef8ddb8d34f6d1d5b2df5c1 100644 (file)
@@ -1329,6 +1329,8 @@ _mesa_free_context_data( struct gl_context *ctx )
    _mesa_reference_program(ctx, &ctx->FragmentProgram._Current, NULL);
    _mesa_reference_program(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
 
+   _mesa_reference_program(ctx, &ctx->ComputeProgram._Current, NULL);
+
    _mesa_reference_vao(ctx, &ctx->Array.VAO, NULL);
    _mesa_reference_vao(ctx, &ctx->Array.DefaultVAO, NULL);