diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-05-09 10:54:26 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-05-09 10:54:26 +0300 |
commit | cc3c15fbddc78bb5377571125cccf57ba7ec3b9a (patch) | |
tree | becd78dc2427aebb8f85fd49fd0023ef2475d339 /source/blender/gpu | |
parent | 78e7b20c0f8dd2e76148f351ef1104375a4a1c94 (diff) |
GPU: Fix crash deferred shader compilation.
On certain systems when eevee is used in a 3d viewport could crash. It
happened more often on slower systems or systems with slower glsl compilers.
For example an Intel Mac Mini. The cause was that even if a GPUMaterial
was in used it could be freed.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/intern/gpu_material.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index e8fb5fb2c45..7ec6ee5183a 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -168,6 +168,7 @@ static void gpu_material_free_single(GPUMaterial *material) if (material->sss_tex_profile != NULL) { GPU_texture_free(material->sss_tex_profile); } + MEM_freeN(material); } void GPU_material_free(ListBase *gpumaterial) @@ -176,7 +177,6 @@ void GPU_material_free(ListBase *gpumaterial) GPUMaterial *material = link->data; DRW_deferred_shader_remove(material); gpu_material_free_single(material); - MEM_freeN(material); } BLI_freelistN(gpumaterial); } |