Ensure that any pending rendering operations in PDFViewer
/PDFThumbnailViewer
are cancelled when the viewer is closed
This commit is contained in:
parent
fb5aa58008
commit
a824c6c4f6
5 changed files with 66 additions and 27 deletions
|
@ -98,8 +98,9 @@ var PDFThumbnailView = (function PDFThumbnailViewClosure() {
|
|||
this.linkService = linkService;
|
||||
this.renderingQueue = renderingQueue;
|
||||
|
||||
this.resume = null;
|
||||
this.renderTask = null;
|
||||
this.renderingState = RenderingStates.INITIAL;
|
||||
this.resume = null;
|
||||
this.disableCanvasToImageConversion = disableCanvasToImageConversion;
|
||||
|
||||
this.pageWidth = this.viewport.width;
|
||||
|
@ -151,11 +152,7 @@ var PDFThumbnailView = (function PDFThumbnailViewClosure() {
|
|||
},
|
||||
|
||||
reset: function PDFThumbnailView_reset() {
|
||||
if (this.renderTask) {
|
||||
this.renderTask.cancel();
|
||||
}
|
||||
this.resume = null;
|
||||
this.renderingState = RenderingStates.INITIAL;
|
||||
this.cancelRendering();
|
||||
|
||||
this.pageWidth = this.viewport.width;
|
||||
this.pageHeight = this.viewport.height;
|
||||
|
@ -199,6 +196,15 @@ var PDFThumbnailView = (function PDFThumbnailViewClosure() {
|
|||
this.reset();
|
||||
},
|
||||
|
||||
cancelRendering: function PDFThumbnailView_cancelRendering() {
|
||||
if (this.renderTask) {
|
||||
this.renderTask.cancel();
|
||||
this.renderTask = null;
|
||||
}
|
||||
this.renderingState = RenderingStates.INITIAL;
|
||||
this.resume = null;
|
||||
},
|
||||
|
||||
/**
|
||||
* @private
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue