From a770d40c3d4977e2c134661b5d8facaea446b6ea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Apr 2008 12:11:24 -0600 Subject: 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. --- src/mesa/state_tracker/st_context.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker/st_context.c') diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index dadc524b51a..8a30871fa07 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); } -- cgit v1.2.3