summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-11 16:09:39 -0600
committerBrian Paul <brianp@vmware.com>2009-05-11 16:09:39 -0600
commitf104e4d666dfccda6f5ad817693216733ddede44 (patch)
treefc794ac5b7c03f37a40e15106fc6e768427f934a /src/mesa/state_tracker/st_context.c
parentf5cf181c65293fd9097f63192c09f44b9c82c633 (diff)
st: do proper refcounting for framebuffer surfaces
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 2a1f21c51c..e536029e86 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -233,6 +233,7 @@ void st_destroy_context( struct st_context *st )
struct pipe_context *pipe = st->pipe;
struct cso_context *cso = st->cso_context;
GLcontext *ctx = st->ctx;
+ GLuint i;
/* need to unbind and destroy CSO objects before anything else */
cso_release_all(st->cso_context);
@@ -240,6 +241,12 @@ void st_destroy_context( struct st_context *st )
st_reference_fragprog(st, &st->fp, NULL);
st_reference_vertprog(st, &st->vp, NULL);
+ /* release framebuffer surfaces */
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&st->state.framebuffer.cbufs[i], NULL);
+ }
+ pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
+
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
_vbo_DestroyContext(st->ctx);