From df43fb661b2030d9b833a42dd47b8d7bf58d73aa Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 6 May 2008 23:08:51 -0600 Subject: implement full reference counting for vertex/fragment programs Use _mesa_reference_vert/fragprog() wherever we assign program pointers. Fixes a memory corruption bug found with glean/api2 test. --- src/mesa/tnl/t_vp_build.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/tnl/t_vp_build.c') diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index a7fd815a26..f254a4d7a4 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -1573,7 +1573,8 @@ void _tnl_UpdateFixedFunctionProgram( GLcontext *ctx ) if (0) _mesa_printf("Found existing TNL program for key %x\n", hash); } - ctx->VertexProgram._Current = ctx->VertexProgram._TnlProgram; + _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, + ctx->VertexProgram._TnlProgram); } /* Tell the driver about the change. Could define a new target for -- cgit v1.2.3