1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

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

@ -63,6 +63,10 @@ var BasePdfManager = (function BasePdfManagerClosure() {
if (this.passwordChangedPromise) {
this.passwordChangedPromise.resolve();
}
},
terminate: function BasePdfManager_terminate() {
return new NotImplementedException();
}
};
@ -115,6 +119,11 @@ var LocalPdfManager = (function LocalPdfManagerClosure() {
return this.loadedStream;
};
LocalPdfManager.prototype.terminate =
function LocalPdfManager_terminate() {
return;
};
return LocalPdfManager;
})();
@ -192,6 +201,11 @@ var NetworkPdfManager = (function NetworkPdfManagerClosure() {
return this.streamManager.onLoadedStream();
};
NetworkPdfManager.prototype.terminate =
function NetworkPdfManager_terminate() {
this.streamManager.networkManager.abortAllRequests();
};
return NetworkPdfManager;
})();