summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorErik Faye-Lund <[email protected]>2015-06-28 14:51:09 +0200
committerMatt Turner <[email protected]>2015-06-29 09:06:40 -0700
commite566e5203aaba98109a67766cf28991de3358490 (patch)
tree0b9977766f1c16225637fb96d7c72e7e556ac444 /src/mesa
parentc61bc6ed844b39e600cc64e3e552c7bf1894d7ba (diff)
mesa/main: free locale at exit
In order to save a small leak if mesa is continously loaded and unloaded, let's free the locale when the shared object is unloaded. 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')
-rw-r--r--src/mesa/main/context.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index e68de68d645..fdef41287f7 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -346,6 +346,16 @@ _mesa_destroy_visual( struct gl_config *vis )
mtx_t OneTimeLock = _MTX_INITIALIZER_NP;
+/**
+ * Calls all the various one-time-fini functions in Mesa
+ */
+
+static void
+one_time_fini(void)
+{
+ _mesa_destroy_shader_compiler();
+ _mesa_locale_fini();
+}
/**
* Calls all the various one-time-init functions in Mesa.
@@ -385,7 +395,7 @@ one_time_init( struct gl_context *ctx )
_mesa_ubyte_to_float_color_tab[i] = (float) i / 255.0F;
}
- atexit(_mesa_destroy_shader_compiler);
+ atexit(one_time_fini);
#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
if (MESA_VERBOSE != 0) {