[Bf-blender-cvs] [bb231515e59] lanpr-under-gp: LineArt: Fix uncaught memory leak in stroke generation.

YimingWu noreply at git.blender.org
Sat Oct 3 05:38:37 CEST 2020


Commit: bb231515e59c341bde5624cae1b7f4c74e1c2712
Author: YimingWu
Date:   Sat Oct 3 11:38:21 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBbb231515e59c341bde5624cae1b7f4c74e1c2712

LineArt: Fix uncaught memory leak in stroke generation.

===================================================================

M	source/blender/editors/lineart/lineart_cpu.c

===================================================================

diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index 2fc5dc13546..90a8f946135 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -4099,6 +4099,8 @@ void ED_lineart_gpencil_generate_from_chain(Depsgraph *depsgraph,
     BKE_gpencil_dvert_ensure(gps);
     gps->mat_nr = material_nr;
 
+    MEM_freeN(stroke_data);
+
     if (source_vgname && vgname) {
       Object *eval_ob = DEG_get_evaluated_object(depsgraph, rlc->object_ref);
       int gpdg = -1;
@@ -4146,7 +4148,6 @@ void ED_lineart_gpencil_generate_from_chain(Depsgraph *depsgraph,
       BKE_gpencil_stroke_set_random_color(gps);
     }
     BKE_gpencil_stroke_geometry_update(gps);
-    MEM_freeN(stroke_data);
     stroke_count++;
   }



More information about the Bf-blender-cvs mailing list