Browse Source

Merge pull request #4920 from nnethercote/zero-canvas-before-deleting

Zero the height and width of the PageView canvas before deleting.
Yury Delendik 11 years ago
parent
commit
12a35f2878
  1. 6
      web/page_view.js

6
web/page_view.js

@ -99,7 +99,13 @@ var PageView = function pageView(container, id, scale,
this.annotationLayer = null; this.annotationLayer = null;
} }
if (this.canvas) {
// Zeroing the width and height causes Firefox to release graphics
// resources immediately, which can greatly reduce memory consumption.
this.canvas.width = 0;
this.canvas.height = 0;
delete this.canvas; delete this.canvas;
}
this.loadingIconDiv = document.createElement('div'); this.loadingIconDiv = document.createElement('div');
this.loadingIconDiv.className = 'loadingIcon'; this.loadingIconDiv.className = 'loadingIcon';

Loading…
Cancel
Save