gallium: fix mem leaks
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 19:48:34 +0000 (13:48 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 20 May 2008 19:49:18 +0000 (13:49 -0600)
src/mesa/state_tracker/st_cb_clear.c

index b7d72046339c3fe4d8e88a880039c620cd6568a0..cdfcdcee72c4adf4da6a91e1fc1ce84e9d9659c7 100644 (file)
@@ -97,6 +97,16 @@ st_destroy_clear(struct st_context *st)
 {
    struct pipe_context *pipe = st->pipe;
 
+   if (st->clear.vert_shader.tokens) {
+      FREE((void *) st->clear.vert_shader.tokens);
+      st->clear.vert_shader.tokens = NULL;
+   }
+
+   if (st->clear.frag_shader.tokens) {
+      FREE((void *) st->clear.frag_shader.tokens);
+      st->clear.frag_shader.tokens = NULL;
+   }
+
    if (st->clear.fs) {
       cso_delete_fragment_shader(st->cso_context, st->clear.fs);
       st->clear.fs = NULL;