summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-04-24 12:11:24 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-04-24 12:15:05 -0600
commita770d40c3d4977e2c134661b5d8facaea446b6ea (patch)
treead72c97ae622bf0c0d952affad0b41de6961a99b /src/mesa/state_tracker/st_context.c
parent386102c62a3315182ffbc6319351cb883234511a (diff)
gallium: use cso_destroy_vertex/fragment_shader() functions
Also, rearrange the st_destroy_context() code a bit to prevent some invalid/NULL ptr derefs during tear-down.
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index dadc524b51..8a30871fa0 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -176,22 +176,29 @@ static void st_destroy_context_priv( struct st_context *st )
}
}
- st->pipe->destroy( st->pipe );
free( st );
}
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;
/* need to unbind and destroy CSO objects before anything else */
- cso_destroy_context(st->cso_context);
+ cso_release_all(st->cso_context);
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
_mesa_free_context_data(ctx);
+
st_destroy_context_priv(st);
+
+ cso_destroy_context(cso);
+
+ pipe->destroy( pipe );
+
free(ctx);
}