mesa: fix geometry shader memory leaks
authorBrian Paul <brianp@vmware.com>
Tue, 8 Jul 2014 22:23:38 +0000 (16:23 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 9 Jul 2014 12:43:26 +0000 (06:43 -0600)
Spotted by Charmaine Lee.
Cc: "10.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/main/context.c
src/mesa/main/shared.c

index b08215950b8ffeff7ff8619fa51f170eabc1be6a..50aae8bf6fa9da2e476726ccc7d067826b33c542 100644 (file)
@@ -1215,6 +1215,9 @@ _mesa_free_context_data( struct gl_context *ctx )
    _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL);
    _mesa_reference_vertprog(ctx, &ctx->VertexProgram._TnlProgram, NULL);
 
+   _mesa_reference_geomprog(ctx, &ctx->GeometryProgram.Current, NULL);
+   _mesa_reference_geomprog(ctx, &ctx->GeometryProgram._Current, NULL);
+
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram.Current, NULL);
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL);
    _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL);
index dc22025c2c69db64ac9b16f55b16e1ed2a8f9206..5ae7014b1cd15be64a87622f239c3766601ea620 100644 (file)
@@ -312,6 +312,7 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared)
    _mesa_DeleteHashTable(shared->Programs);
 
    _mesa_reference_vertprog(ctx, &shared->DefaultVertexProgram, NULL);
+   _mesa_reference_geomprog(ctx, &shared->DefaultGeometryProgram, NULL);
    _mesa_reference_fragprog(ctx, &shared->DefaultFragmentProgram, NULL);
 
    _mesa_HashDeleteAll(shared->ATIShaders, delete_fragshader_cb, ctx);