diff options
author | Mitchell Stokes <mogurijin@gmail.com> | 2011-12-23 11:10:01 +0400 |
---|---|---|
committer | Mitchell Stokes <mogurijin@gmail.com> | 2011-12-23 11:10:01 +0400 |
commit | ac498a6b64ea2f034aa0177894fb25d0401e327b (patch) | |
tree | 6329247e9ec72875eab97d1d5ca87b74bbea6c50 /source/blender/gpu/intern/gpu_codegen.c | |
parent | b59d8c6ba35e43879437e197210bd3900eb56fc9 (diff) |
Cleaning up the GPU_extensions_init/exit() code a bit to keep the Blenderplayer from crashing on exit and restart.
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_codegen.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 7182bbc38e2..d623697921c 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -241,7 +241,12 @@ GPUFunction *GPU_lookup_function(const char *name) return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, (void *)name); } -void GPU_extensions_exit(void) +void GPU_codegen_init(void) +{ + GPU_code_generate_glsl_lib(); +} + +void GPU_codegen_exit(void) { extern Material defmaterial; // render module abuse... @@ -253,8 +258,11 @@ void GPU_extensions_exit(void) FUNCTION_HASH = NULL; } - if(glsl_material_library) + if(glsl_material_library) { MEM_freeN(glsl_material_library); + glsl_material_library = NULL; + } + /*if(FUNCTION_PROTOTYPES) { MEM_freeN(FUNCTION_PROTOTYPES); FUNCTION_PROTOTYPES = NULL; |