diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 8442d0b5f12..c90a9d07561 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1408,23 +1408,6 @@ _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output) } -/** - * Destroy a struct gl_context structure. - * - * \param ctx GL context. - * - * Calls _mesa_free_context_data() and frees the gl_context object itself. - */ -void -_mesa_destroy_context( struct gl_context *ctx ) -{ - if (ctx) { - _mesa_free_context_data(ctx, true); - free( (void *) ctx ); - } -} - - /** * Copy attribute groups from one context to another. * diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 984011dc4d6..f62a9a3f7b7 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -120,10 +120,6 @@ _mesa_initialize_context( struct gl_context *ctx, extern void _mesa_free_context_data(struct gl_context *ctx, bool destroy_debug_output); -extern void -_mesa_destroy_context( struct gl_context *ctx ); - - extern void _mesa_copy_context(const struct gl_context *src, struct gl_context *dst, GLuint mask); diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 815125afca9..e0617157f1b 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -1050,7 +1050,8 @@ st_create_context(gl_api api, struct pipe_context *pipe, st = st_create_context_priv(ctx, pipe, options, no_error); if (!st) { - _mesa_destroy_context(ctx); + _mesa_free_context_data(ctx, true); + align_free(ctx); } return st;