release memory between preview and export
This commit is contained in:
parent
27f0914dd3
commit
1c84425132
5 changed files with 10 additions and 3 deletions
|
|
@ -292,11 +292,15 @@ let gs_kiri_sla = exports;
|
||||||
}, (progress, message) => {
|
}, (progress, message) => {
|
||||||
online({progress: progress * 0.75 + 0.25, message});
|
online({progress: progress * 0.75 + 0.25, message});
|
||||||
});
|
});
|
||||||
|
|
||||||
ondone({
|
ondone({
|
||||||
width: 2560,
|
width: 2560,
|
||||||
height: 1440,
|
height: 1440,
|
||||||
file: file
|
file: file
|
||||||
},[file]);
|
},[file]);
|
||||||
|
|
||||||
|
// release memory
|
||||||
|
print.images = null;
|
||||||
};
|
};
|
||||||
|
|
||||||
// runs in browser main
|
// runs in browser main
|
||||||
|
|
|
||||||
|
|
@ -320,6 +320,7 @@ let gs_kiri_print = exports;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
return newout;
|
return newout;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ function send(fn, data, onreply, async, zerocopy) {
|
||||||
let seq = seqid++;
|
let seq = seqid++;
|
||||||
|
|
||||||
running[seq] = {fn:onreply, async:async||false};
|
running[seq] = {fn:onreply, async:async||false};
|
||||||
|
// console.log('send', data);
|
||||||
worker.postMessage({
|
worker.postMessage({
|
||||||
seq: seq,
|
seq: seq,
|
||||||
task: fn,
|
task: fn,
|
||||||
|
|
@ -56,7 +56,7 @@ KIRI.work = {
|
||||||
reply = e.data,
|
reply = e.data,
|
||||||
record = running[reply.seq],
|
record = running[reply.seq],
|
||||||
onreply = record.fn;
|
onreply = record.fn;
|
||||||
|
// console.log('recv', reply.data)
|
||||||
if (reply.done) {
|
if (reply.done) {
|
||||||
delete running[reply.seq];
|
delete running[reply.seq];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ let dispatch = {
|
||||||
},
|
},
|
||||||
|
|
||||||
clear: function(data, send) {
|
clear: function(data, send) {
|
||||||
|
currentPrint = null;
|
||||||
if (!data.id) {
|
if (!data.id) {
|
||||||
cache = {};
|
cache = {};
|
||||||
currentPrint = null;
|
|
||||||
send.done({ clear: true });
|
send.done({ clear: true });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1822,6 +1822,8 @@ self.kiri.copyright = exports.COPYRIGHT;
|
||||||
updateSelectedInfo();
|
updateSelectedInfo();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case VIEWS.ARRANGE:
|
case VIEWS.ARRANGE:
|
||||||
|
KIRI.work.clear();
|
||||||
|
clearWidgetCache();
|
||||||
showLayerView(false);
|
showLayerView(false);
|
||||||
updateSliderMax();
|
updateSliderMax();
|
||||||
showModeActive(UI.modeArrange);
|
showModeActive(UI.modeArrange);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue