Merge pull request #15869 from Snuffleupagus/_abortOperatorList-clearTimeout
Always abort a pending `streamReader` cancel timeout in `PDFPageProxy._abortOperatorList` (PR 15825 follow-up)
This commit is contained in:
commit
3110d1f29a
@ -1821,6 +1821,12 @@ class PDFPageProxy {
|
|||||||
if (!intentState.streamReader) {
|
if (!intentState.streamReader) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Ensure that a pending `streamReader` cancel timeout is always aborted.
|
||||||
|
if (intentState.streamReaderCancelTimeout) {
|
||||||
|
clearTimeout(intentState.streamReaderCancelTimeout);
|
||||||
|
intentState.streamReaderCancelTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
if (!force) {
|
if (!force) {
|
||||||
// Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.
|
// Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.
|
||||||
// multiple render() calls on the same canvas, won't break all rendering.
|
// multiple render() calls on the same canvas, won't break all rendering.
|
||||||
@ -1837,12 +1843,9 @@ class PDFPageProxy {
|
|||||||
delay += reason.extraDelay;
|
delay += reason.extraDelay;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (intentState.streamReaderCancelTimeout) {
|
|
||||||
clearTimeout(intentState.streamReaderCancelTimeout);
|
|
||||||
}
|
|
||||||
intentState.streamReaderCancelTimeout = setTimeout(() => {
|
intentState.streamReaderCancelTimeout = setTimeout(() => {
|
||||||
this._abortOperatorList({ intentState, reason, force: true });
|
|
||||||
intentState.streamReaderCancelTimeout = null;
|
intentState.streamReaderCancelTimeout = null;
|
||||||
|
this._abortOperatorList({ intentState, reason, force: true });
|
||||||
}, delay);
|
}, delay);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user