From 83ced602a689d1e07ff9a379a678087cec2f77bc Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 4 Dec 2022 16:48:22 -0800 Subject: [PATCH] Free solution memory in Clipper2 The PolyTree64 memory is not automatically freed in the dtor, so call this explicitly --- libs/kimath/src/geometry/shape_poly_set.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/kimath/src/geometry/shape_poly_set.cpp b/libs/kimath/src/geometry/shape_poly_set.cpp index b0612db6ea..165f840fcb 100644 --- a/libs/kimath/src/geometry/shape_poly_set.cpp +++ b/libs/kimath/src/geometry/shape_poly_set.cpp @@ -808,6 +808,7 @@ void SHAPE_POLY_SET::booleanOp( Clipper2Lib::ClipType aType, const SHAPE_POLY_SE c.Execute( aType, Clipper2Lib::FillRule::NonZero, solution ); importTree( solution, zValues, arcBuffer ); + solution.Clear(); // Free used memory (not done in dtor) } @@ -1059,6 +1060,7 @@ void SHAPE_POLY_SET::inflate2( int aAmount, int aCircleSegCount, CORNER_STRATEGY c2.Execute(ClipType::Union, FillRule::Positive, tree); importTree( tree, zValues, arcBuffer ); + tree.Clear(); }