mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-11-22 21:47:59 +01:00
Terminate web worker on error
This commit is contained in:
parent
cb465b9eee
commit
4a61164af9
@ -46,7 +46,11 @@ function sliceAsync(settings, geometry, onProgress) {
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// create the slicer worker
|
// create the slicer worker
|
||||||
const slicerWorker = new SlicerWorker();
|
const slicerWorker = new SlicerWorker();
|
||||||
slicerWorker.onerror = reject;
|
|
||||||
|
slicerWorker.onerror = error => {
|
||||||
|
slicerWorker.terminate();
|
||||||
|
reject(error);
|
||||||
|
};
|
||||||
|
|
||||||
// listen to messages send from worker
|
// listen to messages send from worker
|
||||||
slicerWorker.addEventListener('message', (event) => {
|
slicerWorker.addEventListener('message', (event) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user