mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Closes all promises/streams when handler is destroyed.
This commit is contained in:
parent
25806d17f4
commit
71b0e4e818
3 changed files with 41 additions and 15 deletions
|
@ -14,10 +14,11 @@
|
|||
*/
|
||||
|
||||
import {
|
||||
arrayByteLength, arraysToBytes, assert, createPromiseCapability, info,
|
||||
InvalidPDFException, isNodeJS, MessageHandler, MissingPDFException,
|
||||
PasswordException, setVerbosityLevel, UnexpectedResponseException,
|
||||
UnknownErrorException, UNSUPPORTED_FEATURES, warn, XRefParseException
|
||||
AbortException, arrayByteLength, arraysToBytes, assert,
|
||||
createPromiseCapability, info, InvalidPDFException, isNodeJS, MessageHandler,
|
||||
MissingPDFException, PasswordException, setVerbosityLevel,
|
||||
UnexpectedResponseException, UnknownErrorException, UNSUPPORTED_FEATURES,
|
||||
warn, XRefParseException
|
||||
} from '../shared/util';
|
||||
import { LocalPdfManager, NetworkPdfManager } from './pdf_manager';
|
||||
import { Ref } from './primitives';
|
||||
|
@ -841,7 +842,7 @@ var WorkerMessageHandler = {
|
|||
return Promise.all(waitOn).then(function () {
|
||||
// Notice that even if we destroying handler, resolved response promise
|
||||
// must be sent back.
|
||||
handler.destroy();
|
||||
handler.close(new AbortException('Worker was terminated'));
|
||||
handler = null;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue