[Pkg-javascript-commits] [pdf.js] 174/414: Remove the 'oplist' rendering intent when `getOperatorList` has returned the complete `OperatorList`, and prevent errors in `PDFPageProxy_destroy` for the 'oplist' rendering intent

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:18 UTC 2016


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

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

commit e401804f13fc76b63b7aa68021c11bf45ecd4d49
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Fri Jan 22 13:28:30 2016 +0100

    Remove the 'oplist' rendering intent when `getOperatorList` has returned the complete `OperatorList`, and prevent errors in `PDFPageProxy_destroy` for the 'oplist' rendering intent
---
 src/display/api.js | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/display/api.js b/src/display/api.js
index 96e5774..8ee45c0 100644
--- a/src/display/api.js
+++ b/src/display/api.js
@@ -1034,6 +1034,11 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
       function operatorListChanged() {
         if (intentState.operatorList.lastChunk) {
           intentState.opListReadCapability.resolve(intentState.operatorList);
+
+          var i = intentState.renderTasks.indexOf(opListTask);
+          if (i >= 0) {
+            intentState.renderTasks.splice(i, 1);
+          }
         }
       }
 
@@ -1042,9 +1047,10 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
         this.intentStates[renderingIntent] = Object.create(null);
       }
       var intentState = this.intentStates[renderingIntent];
+      var opListTask;
 
       if (!intentState.opListReadCapability) {
-        var opListTask = {};
+        opListTask = {};
         opListTask.operatorListChanged = operatorListChanged;
         intentState.receivingOperatorList = true;
         intentState.opListReadCapability = createPromiseCapability();
@@ -1087,6 +1093,10 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
 
       var waitOn = [];
       Object.keys(this.intentStates).forEach(function(intent) {
+        if (intent === 'oplist') {
+          // Avoid errors below, since the renderTasks are just stubs.
+          return;
+        }
         var intentState = this.intentStates[intent];
         intentState.renderTasks.forEach(function(renderTask) {
           var renderCompleted = renderTask.capability.promise.

-- 
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