From ac498a6b64ea2f034aa0177894fb25d0401e327b Mon Sep 17 00:00:00 2001 From: Mitchell Stokes Date: Fri, 23 Dec 2011 07:10:01 +0000 Subject: Cleaning up the GPU_extensions_init/exit() code a bit to keep the Blenderplayer from crashing on exit and restart. --- source/blender/gpu/intern/gpu_codegen.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source/blender/gpu/intern/gpu_codegen.c') 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; -- cgit v1.2.3