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 82f24b5c8cfb6305f68f473f787f7db1e343261f..042126802a5858c28de45dad5614d8a24bcaa344 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);
                }
                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);
                MEM_freeN(prepass_frag);
                MEM_freeN(composite_frag);
                MEM_freeN(defines);
index cf7a7858f7a23423cbf995878fc5f3a67e929244..3ed0c207becb8503c0d8ec012a79409125910ec9 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(forward_vert);
                MEM_freeN(forward_depth_frag);
                MEM_freeN(defines);
+               MEM_freeN(defines_hair);
        }
        select_forward_shaders(wpd);
 
        }
        select_forward_shaders(wpd);