From dff17b0893c5c8c23c68531557109d1f053933ac Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Wed, 13 Oct 2021 16:22:17 +0200 Subject: Fix T92185: GPencil memory leak removing stroke from python The API was not removing the weights, points and traingulation data. Only it was removing the stroke itself. --- source/blender/makesrna/intern/rna_gpencil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index 44de5955c41..149b0d293e3 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -906,7 +906,8 @@ static void rna_GPencil_stroke_remove(ID *id, return; } - BLI_freelinkN(&frame->strokes, stroke); + BLI_remlink(&frame->strokes, stroke); + BKE_gpencil_free_stroke(stroke); RNA_POINTER_INVALIDATE(stroke_ptr); DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_COPY_ON_WRITE); -- cgit v1.2.3