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.
This commit is contained in:
parent
bb7c858598
commit
577239d2ce
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue