Merge pull request #16881 from Snuffleupagus/InternalRenderTask-tweaks

A couple of small `InternalRenderTask` changes
This commit is contained in:
Tim van der Meij 2023-09-03 13:05:31 +02:00 committed by GitHub
commit 1e7c907fbf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3378,10 +3378,8 @@ class InternalRenderTask {
this.running = false;
this.cancelled = true;
this.gfx?.endDrawing();
InternalRenderTask.#canvasInUse.delete(this._canvas);
if (this._canvas) {
InternalRenderTask.#canvasInUse.delete(this._canvas);
}
this.callback(
error ||
new RenderingCancelledException(
@ -3439,10 +3437,9 @@ class InternalRenderTask {
if (this.operatorListIdx === this.operatorList.argsArray.length) {
this.running = false;
if (this.operatorList.lastChunk) {
this.gfx.endDrawing(this.pageColors);
if (this._canvas) {
InternalRenderTask.#canvasInUse.delete(this._canvas);
}
this.gfx.endDrawing();
InternalRenderTask.#canvasInUse.delete(this._canvas);
this.callback();
}
}