gallium: fix vertex shader mem leak (glRasterPos)
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 21:20:29 +0000 (15:20 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 21:20:29 +0000 (15:20 -0600)
src/mesa/state_tracker/st_cb_program.c

index a1694d93c5dc87fd8337a780e68f42d258919d55..5f753afdd3635b6cc48590d326ce962ff511c71f 100644 (file)
@@ -143,6 +143,12 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog)
             stvp->driver_shader = NULL;
          }
 
+         if (stvp->draw_shader) {
+            /* this would only have been allocated for the RasterPos path */
+            draw_delete_vertex_shader(st->draw, stvp->draw_shader);
+            stvp->draw_shader = NULL;
+         }
+
          if (stvp->state.tokens) {
             FREE((void *) stvp->state.tokens);
             stvp->state.tokens = NULL;
@@ -225,6 +231,7 @@ static void st_program_string_notify( GLcontext *ctx,
       }
 
       if (stvp->draw_shader) {
+         /* this would only have been allocated for the RasterPos path */
          draw_delete_vertex_shader(st->draw, stvp->draw_shader);
          stvp->draw_shader = NULL;
       }