mesa: Remove _mesa_destroy_context()
authorRob Clark <robdclark@chromium.org>
Sun, 31 Jan 2021 16:58:09 +0000 (08:58 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 1 Feb 2021 01:33:02 +0000 (01:33 +0000)
There was only one caller, an error path in mesa/st.  But this is now
incorrect as we need align_free().  Just remove it.

Fixes: 55e853d823e ("mesa/st: Allocate the gl_context with 16-byte alignment.")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8801>

src/mesa/main/context.c
src/mesa/main/context.h
src/mesa/state_tracker/st_context.c

index 8442d0b..c90a9d0 100644 (file)
@@ -1409,23 +1409,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.
  *
  * \param src source context
index 984011d..f62a9a3 100644 (file)
@@ -121,10 +121,6 @@ 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);
 
 extern GLboolean
index 815125a..e061715 100644 (file)
@@ -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;