Mesa (mesa_7_5_branch): draw: free more token arrays
Keith Whitwell
keithw at kemper.freedesktop.org
Tue Jun 2 03:36:19 UTC 2009
Module: Mesa
Branch: mesa_7_5_branch
Commit: 003cfd4dd2491675058c53a8f59553f2443be349
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=003cfd4dd2491675058c53a8f59553f2443be349
Author: Keith Whitwell <keithw at vmware.com>
Date: Mon Jun 1 20:15:28 2009 -0700
draw: free more token arrays
The AA line and point code also needs to free token arrays after
building driver shaders.
---
src/gallium/auxiliary/draw/draw_pipe_aaline.c | 9 ++++++---
src/gallium/auxiliary/draw/draw_pipe_aapoint.c | 8 ++++++--
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
index 9fedeef..0d322b0 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c
@@ -60,8 +60,6 @@ struct aaline_fragment_shader
struct pipe_shader_state state;
void *driver_fs;
void *aaline_fs;
- void *aapoint_fs; /* not yet */
- void *sprite_fs; /* not yet */
uint sampler_unit;
int generic_attrib; /**< texcoord/generic used for texture */
};
@@ -373,10 +371,15 @@ generate_aaline_fs(struct aaline_stage *aaline)
aaline->fs->aaline_fs
= aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
if (aaline->fs->aaline_fs == NULL)
- return FALSE;
+ goto fail;
aaline->fs->generic_attrib = transform.maxGeneric + 1;
+ FREE((void *)aaline_fs.tokens);
return TRUE;
+
+fail:
+ FREE((void *)aaline_fs.tokens);
+ return FALSE;
}
diff --git a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
index 66839f7..729cf75 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_aapoint.c
@@ -523,11 +523,15 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
aapoint->fs->aapoint_fs
= aapoint->driver_create_fs_state(aapoint->pipe, &aapoint_fs);
if (aapoint->fs->aapoint_fs == NULL)
- return FALSE;
+ goto fail;
aapoint->fs->generic_attrib = transform.maxGeneric + 1;
-
+ FREE((void *)aapoint_fs.tokens);
return TRUE;
+
+fail:
+ FREE((void *)aapoint_fs.tokens);
+ return FALSE;
}
More information about the mesa-commit
mailing list