mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #10499 from Snuffleupagus/renderTask-error-cleanup
Attempt to clean-up/restore pending rendering operations when errors occurs while a `RenderTask` runs (PR 10202 follow-up)
This commit is contained in:
commit
1f3e7700d2
2 changed files with 8 additions and 9 deletions
|
@ -432,7 +432,7 @@ class PDFPageView {
|
|||
};
|
||||
}
|
||||
|
||||
let finishPaintTask = (error) => {
|
||||
const finishPaintTask = async (error) => {
|
||||
// The paintTask may have been replaced by a new one, so only remove
|
||||
// the reference to the paintTask if it matches the one that is
|
||||
// triggering this callback.
|
||||
|
@ -442,7 +442,7 @@ class PDFPageView {
|
|||
|
||||
if (error instanceof RenderingCancelledException) {
|
||||
this.error = null;
|
||||
return Promise.resolve(undefined);
|
||||
return;
|
||||
}
|
||||
|
||||
this.renderingState = RenderingStates.FINISHED;
|
||||
|
@ -465,9 +465,8 @@ class PDFPageView {
|
|||
});
|
||||
|
||||
if (error) {
|
||||
return Promise.reject(error);
|
||||
throw error;
|
||||
}
|
||||
return Promise.resolve(undefined);
|
||||
};
|
||||
|
||||
let paintTask = this.renderer === RendererType.SVG ?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue