Prevent undefined error on null object when calling .destroy on a

document initialized with LocalPdfManager.

Per @brendandahl's recommendation, moved the terminate function out of worker
and into the PdfManager
This commit is contained in:
biggert 2013-09-25 16:25:41 -05:00
parent 1bcb3efd4a
commit fb957f5c6e
2 changed files with 15 additions and 1 deletions

View file

@ -368,7 +368,7 @@ var WorkerMessageHandler = PDFJS.WorkerMessageHandler = {
});
handler.on('Terminate', function wphTerminate(data, promise) {
pdfManager.streamManager.networkManager.abortAllRequests();
pdfManager.terminate();
promise.resolve();
});
}