test free mem on slice
This commit is contained in:
parent
c30ecdeef5
commit
e1aa2bfaca
3 changed files with 30 additions and 0 deletions
1
notes.md
1
notes.md
|
|
@ -76,6 +76,7 @@
|
||||||
* `B` need to force cut line at synthetic z bottom (midlines, etc)
|
* `B` need to force cut line at synthetic z bottom (midlines, etc)
|
||||||
* `B` contour does not honor clip to stock
|
* `B` contour does not honor clip to stock
|
||||||
|
|
||||||
|
* `F` get gcode coordinates off a part with point/click or hover?
|
||||||
* `F` include tools in default devices (Carvera)
|
* `F` include tools in default devices (Carvera)
|
||||||
* `F` add `match faces` option in `outline` operation
|
* `F` add `match faces` option in `outline` operation
|
||||||
* `F` add {progress} substitution and maybe {time-remaining} if can be calc'd
|
* `F` add {progress} substitution and maybe {time-remaining} if can be calc'd
|
||||||
|
|
|
||||||
|
|
@ -1285,6 +1285,18 @@ class Polygon {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
freeParentRefs() {
|
||||||
|
if (this.inner && this.inner.length > 0) {
|
||||||
|
for (let inner of this.inner) {
|
||||||
|
inner.freeParentRefs();
|
||||||
|
delete inner.parent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (let p of this.points) {
|
||||||
|
delete p.poly;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
newUndeleted() {
|
newUndeleted() {
|
||||||
let poly = newPolygon();
|
let poly = newPolygon();
|
||||||
this.forEachPoint(p => {
|
this.forEachPoint(p => {
|
||||||
|
|
|
||||||
|
|
@ -402,6 +402,23 @@ async function sliceZ(z, points, options = {}) {
|
||||||
if (fn) fn(rval, 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);
|
if (each) each(rval);
|
||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue