1
0
Fork 0
mirror of https://github.com/codedread/bitjs synced 2025-10-06 10:49:55 +02:00

Add ability to stop an Unarchiver and terminate its worker

This commit is contained in:
codedread 2014-06-12 01:10:12 -05:00
parent a2298d361b
commit de1bc5243c

View file

@ -305,7 +305,17 @@ bitjs.archive.Unarchiver.prototype.handleWorkerEvent_ = function(e) {
this.worker_.postMessage({file: this.ab}); this.worker_.postMessage({file: this.ab});
} }
};
/**
* Terminates the Web Worker for this Unarchiver and returns immediately.
*/
bitjs.archive.Unarchiver.prototype.stop = function() {
if (this.worker_) {
this.worker_.terminate();
} }
};
/** /**
* Unzipper * Unzipper