Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2019-09-13 12:18:40 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-09-13 12:18:48 +0300
commit577239d2ced993ffe795ee209b303ef1af55d962 (patch)
tree95f4c2cfde380ccefaeea7da0dea4c149f64b951 /source/blender/blenkernel/intern/gpencil.c
parentbb7c858598ff263eb29f676ec8ef8b2f43b20c43 (diff)
GPencil: Fix unreported memory leak for weights
As the total of points was changed before free memory, if the total was lower than before, the remaining points were not released.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 9ac61c69d04..b93cfefa97d 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1730,7 +1730,6 @@ bool BKE_gpencil_sample_stroke(bGPDstroke *gps, const float dist, const bool sel
}
gps->points = new_pt;
- gps->totpoints = i;
MEM_freeN(pt); /* original */
if (new_dv) {
@@ -1741,6 +1740,8 @@ bool BKE_gpencil_sample_stroke(bGPDstroke *gps, const float dist, const bool sel
gps->dvert = new_dv;
}
+ gps->totpoints = i;
+
gps->flag |= GP_STROKE_RECALC_GEOMETRY;
gps->tot_triangles = 0;