summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2015-06-28 14:51:06 +0200
committerMatt Turner <[email protected]>2015-06-29 09:06:40 -0700
commit195ab79ddecbdbf1f1714c233df278bff46c13e8 (patch)
treecf57e354934d9a10fe8cd7df786072cbf44bc7b4 /src/mesa/main/context.c
parentba5e1612c892282b930e278b5b98f1578cbe7dbb (diff)
mesa/main: only call _mesa_destroy_shader_compiler once on exit
There's no point in calling _mesa_destroy_shader_compiler multiple times on exit; the resources will only be released once anyway. So let's move the atexit-call into the part that is only called once. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 265f98aea46..c4af8ea16db 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -382,6 +382,8 @@ one_time_init( struct gl_context *ctx )
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
+ atexit(_mesa_destroy_shader_compiler);
+
#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
if (MESA_VERBOSE != 0) {
_mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
@@ -404,11 +406,6 @@ one_time_init( struct gl_context *ctx )
api_init_mask |= 1 << ctx->API;
mtx_unlock(&OneTimeLock);
-
- /* Hopefully atexit() is widely available. If not, we may need some
- * #ifdef tests here.
- */
- atexit(_mesa_destroy_shader_compiler);
}