diff --git a/web/viewer.js b/web/viewer.js index f2ca40c3f..aeecd8606 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -524,6 +524,10 @@ var PDFView = { } } + // Terminate worker of the previous document if any. + if (this.pdfDocument) { + this.pdfDocument.destroy(); + } this.pdfDocument = null; var self = this; self.loading = true;