Skip to content

Commit

Permalink
rm releaseImageResources
Browse files Browse the repository at this point in the history
  • Loading branch information
Snuffleupagus committed Feb 14, 2020
1 parent 8179a45 commit 5174f0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 24 deletions.
9 changes: 0 additions & 9 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ import {
DOMCMapReaderFactory,
loadScript,
PageViewport,
releaseImageResources,
RenderingCancelledException,
StatTimer,
} from "./display_utils.js";
Expand Down Expand Up @@ -2554,14 +2553,6 @@ class PDFObjects {
}

clear() {
for (const objId in this._objs) {
const { data } = this._objs[objId];

if (typeof Image !== "undefined" && data instanceof Image) {
// Always release the image data when clearing out the cached objects.
releaseImageResources(data);
}
}
this._objs = Object.create(null);
}
}
Expand Down
15 changes: 0 additions & 15 deletions src/display/display_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -514,20 +514,6 @@ function deprecated(details) {
console.log("Deprecated API usage: " + details);
}

function releaseImageResources(img) {
assert(img instanceof Image, "Invalid `img` parameter.");

const url = img.src;
if (
typeof url === "string" &&
url.startsWith("blob:") &&
URL.revokeObjectURL
) {
URL.revokeObjectURL(url);
}
img.removeAttribute("src");
}

let pdfDateStringRegex;

class PDFDateString {
Expand Down Expand Up @@ -628,6 +614,5 @@ export {
isValidFetchUrl,
loadScript,
deprecated,
releaseImageResources,
PDFDateString,
};

0 comments on commit 5174f0f

Please sign in to comment.