summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-03-22 10:29:30 -0600
committerBrian <[email protected]>2008-03-22 10:29:30 -0600
commita35c1ca3ad4361fee30d21ef13d8d37ae91aee66 (patch)
tree43b21696c8f9c811d148e3a4c0b12f75201b2673 /src/mesa/state_tracker/st_program.c
parentf8acc3965e3fa9ec40ca63f3ddd0cb33966e8c95 (diff)
gallium: fix a few more shader-related mem leaks
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index d9d11ee0e84..101a6a48afd 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -260,6 +260,16 @@ st_translate_vertex_program(struct st_context *st,
outputMapping = defaultOutputMapping;
}
+ /* free old shader state, if any */
+ if (stvp->state.tokens) {
+ FREE((void *) stvp->state.tokens);
+ stvp->state.tokens = NULL;
+ }
+ if (stvp->driver_shader) {
+ pipe->delete_vs_state(pipe, stvp->driver_shader);
+ stvp->driver_shader = NULL;
+ }
+
/* XXX: fix static allocation of tokens:
*/
num_tokens = tgsi_translate_mesa_program( TGSI_PROCESSOR_VERTEX,