Cleaning up the GPU_extensions_init/exit() code a bit to keep the Blenderplayer from crashing on exit and restart.

This commit is contained in:
2011-12-23 07:10:01 +00:00
parent b59d8c6ba3
commit ac498a6b64
4 changed files with 29 additions and 7 deletions

View File

@@ -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;