avoid worker restart unless it's slicing

This commit is contained in:
Stewart Allen 2018-03-14 17:47:40 -04:00
commit 41d30cef0c
3 changed files with 8 additions and 2 deletions

View file

@ -39,6 +39,12 @@ if (self.window) {
}
KIRI.work = {
isSlicing : function() {
var current = 0;
for (var key in slicing) { current++ }
return current > 0;
},
restart : function() {
if (worker) worker.terminate();

View file

@ -2556,7 +2556,7 @@ self.kiri.license = exports.LICENSE;
// hide all dialogs
hideDialog();
// cancel slicing
KIRI.work.restart();
if (KIRI.work.isSlicing()) KIRI.work.restart();
break;
}
return false;

View file

@ -1,7 +1,7 @@
var exports = {
COPYRIGHT:"Copyright (C) 2014-2017 Stewart Allen <stewart@neuron.com> - All Rights Reserved",
LICENSE:"Unauthorized copying, modification and re-distribution are strictly prohibited without prior written consent.",
VERSION:"1.2.0"
VERSION:"1.2.1"
};
if (!module) var module = {};
module.exports = exports;