summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_context.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-04-17 11:12:44 -0600
committerBrian Paul <[email protected]>2008-04-17 11:13:49 -0600
commitf2b3f6cbdfc4799a0f742c06d2ce0755582c50c4 (patch)
tree660808d8c8f848bc8869c8b4d6644bde8b9ce414 /src/mesa/state_tracker/st_context.c
parent4dcb09d48981f07a82d7f609fe492453c8fdbcf4 (diff)
gallium: reorder some of the destroy context code
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r--src/mesa/state_tracker/st_context.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 154327239de..dadc524b51a 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -170,10 +170,6 @@ static void st_destroy_context_priv( struct st_context *st )
_vbo_DestroyContext(st->ctx);
- cso_destroy_context(st->cso_context);
-
- _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) {
pipe_buffer_reference(ws, &st->state.constants[i].buffer, NULL);
@@ -188,6 +184,12 @@ static void st_destroy_context_priv( struct st_context *st )
void st_destroy_context( struct st_context *st )
{
GLcontext *ctx = st->ctx;
+
+ /* need to unbind and destroy CSO objects before anything else */
+ cso_destroy_context(st->cso_context);
+
+ _mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
+
_mesa_free_context_data(ctx);
st_destroy_context_priv(st);
free(ctx);