Remove the, now unused, releaseImageResources
helper function
With the changes in the previous patch, this is now dead code which should thus be removed.
This commit is contained in:
parent
0351852d74
commit
cc4cc8b11b
@ -43,7 +43,6 @@ import {
|
|||||||
DOMCMapReaderFactory,
|
DOMCMapReaderFactory,
|
||||||
loadScript,
|
loadScript,
|
||||||
PageViewport,
|
PageViewport,
|
||||||
releaseImageResources,
|
|
||||||
RenderingCancelledException,
|
RenderingCancelledException,
|
||||||
StatTimer,
|
StatTimer,
|
||||||
} from "./display_utils.js";
|
} from "./display_utils.js";
|
||||||
@ -2581,14 +2580,6 @@ class PDFObjects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
clear() {
|
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);
|
this._objs = Object.create(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -517,20 +517,6 @@ function deprecated(details) {
|
|||||||
console.log("Deprecated API usage: " + 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;
|
let pdfDateStringRegex;
|
||||||
|
|
||||||
class PDFDateString {
|
class PDFDateString {
|
||||||
@ -631,6 +617,5 @@ export {
|
|||||||
isValidFetchUrl,
|
isValidFetchUrl,
|
||||||
loadScript,
|
loadScript,
|
||||||
deprecated,
|
deprecated,
|
||||||
releaseImageResources,
|
|
||||||
PDFDateString,
|
PDFDateString,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user