summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r600/r600_state.c
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2010-10-23 13:33:15 +0200
committerDave Airlie <airlied@redhat.com>2010-10-24 12:44:56 +1000
commit9f9d24c89a2286f952b123c703e8268d2f1aa719 (patch)
treeea62f9c512ae6f2b3009089bd288774b5d06f925 /src/gallium/drivers/r600/r600_state.c
parentd8740b77ac30298c1742107e2afc4edabca562f0 (diff)
r600g: Fixed r600_vertex_element leak.
Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/gallium/drivers/r600/r600_state.c')
-rw-r--r--src/gallium/drivers/r600/r600_state.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index df2c05ea13..7100529764 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -755,13 +755,12 @@ static void r600_delete_state(struct pipe_context *ctx, void *state)
static void r600_delete_vertex_element(struct pipe_context *ctx, void *state)
{
- struct r600_vertex_element *v = (struct r600_vertex_element*)state;
+ struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
- if (v == NULL)
- return;
- if (--v->refcount)
- return;
- free(v);
+ FREE(state);
+
+ if (rctx->vertex_elements == state)
+ rctx->vertex_elements = NULL;
}
static void r600_set_clip_state(struct pipe_context *ctx,
@@ -804,10 +803,8 @@ static void r600_bind_vertex_elements(struct pipe_context *ctx, void *state)
struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx;
struct r600_vertex_element *v = (struct r600_vertex_element*)state;
- r600_delete_vertex_element(ctx, rctx->vertex_elements);
rctx->vertex_elements = v;
if (v) {
- v->refcount++;
// rctx->vs_rebuild = TRUE;
}
}