test free mem on slice

This commit is contained in:
Stewart Allen 2023-01-10 21:28:35 -05:00
commit e1aa2bfaca
3 changed files with 30 additions and 0 deletions

View file

@ -402,6 +402,23 @@ async function sliceZ(z, points, options = {}) {
if (fn) fn(rval, options);
}
// free objects to be re-claimed and reduce memory pressure
if (false) {
delete rval.groups
delete rval.lines
delete rval.clip.m_AllPolys
for (let top of rval.tops) {
top.poly.freeParentRefs();
top.simple.freeParentRefs();
for (let shell of top.shells) shell.freeParentRefs();
for (let fillo of top.fill_off) fillo.freeParentRefs();
for (let last of top.last) last.freeParentRefs();
}
for (let clip of rval.clip) clip.freeParentRefs();
}
if (each) each(rval);
return rval;
}