summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_vp_build.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-05-06 23:08:51 -0600
committerBrian <[email protected]>2008-05-06 23:08:51 -0600
commitdf43fb661b2030d9b833a42dd47b8d7bf58d73aa (patch)
treefe53a42d227411380c67d66f05e4f2f9c323bb69 /src/mesa/tnl/t_vp_build.c
parent38c5b148531b1f470956bb9d66757e7301ce0535 (diff)
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.
Diffstat (limited to 'src/mesa/tnl/t_vp_build.c')
-rw-r--r--src/mesa/tnl/t_vp_build.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c
index a7fd815a260..f254a4d7a4d 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