From a35c1ca3ad4361fee30d21ef13d8d37ae91aee66 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 22 Mar 2008 10:29:30 -0600 Subject: gallium: fix a few more shader-related mem leaks --- src/mesa/state_tracker/st_program.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa/state_tracker/st_program.c') 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, -- cgit v1.2.3