summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-12-26 07:16:41 -0700
committerBrian <brian.paul@tungstengraphics.com>2008-01-01 10:21:21 -0700
commit4fabee9d4d217bb18411b6c481416775aead029e (patch)
tree974824eac53f94ac83650e4342444941fe5dda80 /src/mesa/pipe/softpipe
parent6128c938650f3937ba54dd7225d258d753e16ade (diff)
unref const buffers during context destroy
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 52672a9b29..c7af63cc2d 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -127,6 +127,7 @@ softpipe_unmap_surfaces(struct softpipe_context *sp)
static void softpipe_destroy( struct pipe_context *pipe )
{
struct softpipe_context *softpipe = softpipe_context( pipe );
+ struct pipe_winsys *ws = pipe->winsys;
uint i;
draw_destroy( softpipe->draw );
@@ -152,6 +153,12 @@ static void softpipe_destroy( struct pipe_context *pipe )
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
sp_destroy_tile_cache(softpipe->tex_cache[i]);
+ for (i = 0; i < Elements(softpipe->constants); i++) {
+ if (softpipe->constants[i].buffer) {
+ ws->buffer_reference(ws, &softpipe->constants[i].buffer, NULL);
+ }
+ }
+
FREE( softpipe );
}