mirror of
https://github.com/Doodle3D/Doodle3D-Slicer.git
synced 2024-12-23 03:23:48 +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) => {
|
||||
// create the slicer worker
|
||||
const slicerWorker = new SlicerWorker();
|
||||
slicerWorker.onerror = reject;
|
||||
|
||||
slicerWorker.onerror = error => {
|
||||
slicerWorker.terminate();
|
||||
reject(error);
|
||||
};
|
||||
|
||||
// listen to messages send from worker
|
||||
slicerWorker.addEventListener('message', (event) => {
|
||||
|
Loading…
Reference in New Issue
Block a user