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.
This commit is contained in:
Brian Paul
2008-04-24 12:11:24 -06:00
parent 386102c62a
commit a770d40c3d
5 changed files with 18 additions and 13 deletions

View File

@@ -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);
}