[Pkg-javascript-commits] [pdf.js] 73/207: Cache pages at the start of drawing, not the end.

David Prévot taffit at moszumanska.debian.org
Mon Jul 28 15:36:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 29d3db44223aaba6b4a2ca536d7cf4df2d1f91e4
Author: Nicholas Nethercote <nnethercote at mozilla.com>
Date:   Thu Jun 12 22:30:23 2014 -0700

    Cache pages at the start of drawing, not the end.
---
 web/page_view.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/web/page_view.js b/web/page_view.js
index d90419e..95b13d4 100644
--- a/web/page_view.js
+++ b/web/page_view.js
@@ -591,8 +591,6 @@ var PageView = function pageView(container, id, scale,
         self.onAfterDraw();
       }
 
-      cache.push(self);
-
       var event = document.createEvent('CustomEvent');
       event.initCustomEvent('pagerender', true, true, {
         pageNumber: pdfPage.pageNumber
@@ -645,6 +643,10 @@ var PageView = function pageView(container, id, scale,
 
     setupAnnotations(div, pdfPage, this.viewport);
     div.setAttribute('data-loaded', true);
+
+    // Add the page to the cache at the start of drawing. That way it can be
+    // evicted from the cache and destroyed even if we pause its rendering.
+    cache.push(this);
   };
 
   this.beforePrint = function pageViewBeforePrint() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list