Workbench: Fix memleaks.
authorClément Foucault <foucault.clem@gmail.com>
Sun, 3 Jun 2018 13:26:53 +0000 (15:26 +0200)
committerClément Foucault <foucault.clem@gmail.com>
Sun, 3 Jun 2018 13:26:53 +0000 (15:26 +0200)
source/blender/draw/engines/workbench/workbench_deferred.c
source/blender/draw/engines/workbench/workbench_forward.c

index 82f24b5..0421268 100644 (file)
@@ -159,6 +159,7 @@ static void ensure_deferred_shaders(WORKBENCH_PrivateData *wpd, int index, int d
                if (drawtype == OB_SOLID && !is_hair) {
                        e_data.composite_sh_cache[index] = DRW_shader_create_fullscreen(composite_frag, defines);
                }
+               MEM_freeN(prepass_vert);
                MEM_freeN(prepass_frag);
                MEM_freeN(composite_frag);
                MEM_freeN(defines);
index cf7a785..3ed0c20 100644 (file)
@@ -316,6 +316,7 @@ void workbench_forward_engine_init(WORKBENCH_Data *vedata)
                MEM_freeN(forward_vert);
                MEM_freeN(forward_depth_frag);
                MEM_freeN(defines);
+               MEM_freeN(defines_hair);
        }
        select_forward_shaders(wpd);