diff --git a/js/kiri-driver-sla.js b/js/kiri-driver-sla.js index 66c464bd..7638d20e 100644 --- a/js/kiri-driver-sla.js +++ b/js/kiri-driver-sla.js @@ -292,11 +292,15 @@ let gs_kiri_sla = exports; }, (progress, message) => { online({progress: progress * 0.75 + 0.25, message}); }); + ondone({ width: 2560, height: 1440, file: file },[file]); + + // release memory + print.images = null; }; // runs in browser main diff --git a/js/kiri-print.js b/js/kiri-print.js index 3b421635..93fa82ce 100644 --- a/js/kiri-print.js +++ b/js/kiri-print.js @@ -320,6 +320,7 @@ let gs_kiri_print = exports; } }); }); + return newout; }; diff --git a/js/kiri-work.js b/js/kiri-work.js index 7913ad72..adbd0cad 100644 --- a/js/kiri-work.js +++ b/js/kiri-work.js @@ -20,7 +20,7 @@ function send(fn, data, onreply, async, zerocopy) { let seq = seqid++; running[seq] = {fn:onreply, async:async||false}; - + // console.log('send', data); worker.postMessage({ seq: seq, task: fn, @@ -56,7 +56,7 @@ KIRI.work = { reply = e.data, record = running[reply.seq], onreply = record.fn; - + // console.log('recv', reply.data) if (reply.done) { delete running[reply.seq]; } diff --git a/js/kiri-worker.js b/js/kiri-worker.js index fb4d9014..1c1c2adf 100644 --- a/js/kiri-worker.js +++ b/js/kiri-worker.js @@ -140,9 +140,9 @@ let dispatch = { }, clear: function(data, send) { + currentPrint = null; if (!data.id) { cache = {}; - currentPrint = null; send.done({ clear: true }); return; } diff --git a/js/kiri.js b/js/kiri.js index b36d1b07..ad053e73 100644 --- a/js/kiri.js +++ b/js/kiri.js @@ -1822,6 +1822,8 @@ self.kiri.copyright = exports.COPYRIGHT; updateSelectedInfo(); switch (mode) { case VIEWS.ARRANGE: + KIRI.work.clear(); + clearWidgetCache(); showLayerView(false); updateSliderMax(); showModeActive(UI.modeArrange);