summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-01-02 23:02:35 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-01-02 23:02:35 +1100
commit720fd7b5e993c7e77e5b1fc75edeedd110532e0e (patch)
tree568e60e4e3a09ca09a16fc59b709c81b7c9a23ee /src/mesa/state_tracker/st_context.c
parent92ee96d83d26e56857b2999356d7c2a75e6eaf76 (diff)
parentda92ac01e80e8a83233b1d4a881503bfc2806a1a (diff)
Merge branch 'upstream-gallium-0.1' into darktama-gallium-0.1
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 1d26da474e..668ac139f7 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -51,6 +51,7 @@
#include "st_extensions.h"
#include "st_program.h"
#include "pipe/p_context.h"
+#include "pipe/p_winsys.h"
#include "pipe/draw/draw_context.h"
#include "pipe/cso_cache/cso_cache.h"
@@ -136,6 +137,9 @@ struct st_context *st_create_context(struct pipe_context *pipe,
static void st_destroy_context_priv( struct st_context *st )
{
+ struct pipe_winsys *ws = st->pipe->winsys;
+ uint i;
+
draw_destroy(st->draw);
st_destroy_atoms( st );
st_destroy_draw( st );
@@ -146,6 +150,12 @@ static void st_destroy_context_priv( struct st_context *st )
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
+ for (i = 0; i < Elements(st->state.constants); i++) {
+ if (st->state.constants[i].buffer) {
+ ws->buffer_reference(ws, &st->state.constants[i].buffer, NULL);
+ }
+ }
+
st->pipe->destroy( st->pipe );
free( st );
}