diff options
author | Brian Paul <[email protected]> | 2010-08-27 11:54:32 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-08-27 14:30:59 -0600 |
commit | 579fce252413f39830ee379076fddf0580ea9b16 (patch) | |
tree | 20236a3fe520cc002add1f7390b8ab46d66acc0f /src/mesa/main | |
parent | b820bf979a1c308d8d6fe6ad89e8ae7c77226603 (diff) |
mesa: use atexit() handler to release GLSL compiler memory
This releases a bunch of memory that was showing up as leaks with
valgrind.
If atexit() isn't widely supported we may need to add some #ifdef
tests around the call.
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/context.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 6205d3456a4..4852f466469 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -140,6 +140,10 @@ #include "sparc/sparc.h" #endif +#include "glsl_parser_extras.h" + + + #ifndef MESA_VERBOSE int MESA_VERBOSE = 0; #endif @@ -434,6 +438,11 @@ one_time_init( GLcontext *ctx ) } _glthread_UNLOCK_MUTEX(OneTimeLock); + /* Hopefully atexit() is widely available. If not, we may need some + * #ifdef tests here. + */ + atexit(_mesa_destroy_shader_compiler); + dummy_enum_func(); } |