Revoke the blob-URLs used during printing in PDFPrintService
This commit is contained in:
parent
502a429e3e
commit
6a1b1ae6a4
@ -199,10 +199,18 @@ class PDFPrintService {
|
||||
wrapper.append(img);
|
||||
this.printContainer.append(wrapper);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
img.onload = resolve;
|
||||
img.onerror = reject;
|
||||
});
|
||||
const { promise, resolve, reject } = Promise.withResolvers();
|
||||
img.onload = resolve;
|
||||
img.onerror = reject;
|
||||
|
||||
promise
|
||||
.catch(() => {
|
||||
// Avoid "Uncaught promise" messages in the console.
|
||||
})
|
||||
.then(() => {
|
||||
URL.revokeObjectURL(img.src);
|
||||
});
|
||||
return promise;
|
||||
}
|
||||
|
||||
performPrint() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user