Resolved severe memory leak (mozPrintCallback)
Do NOT save the temporary <canvas> element as `this.canvas`. `PDFViewer.pages[i].canvas` appears to be used to generate the thumbnail icons. Well, that's no justification for preventing GC of those temporary <canvas> elements used during mozPrintCallback. With a document consisting of 79 pages, this resulted in a 600-700MB leaked memory.
This commit is contained in:
parent
1731c0fb42
commit
194a734e5d
@ -514,7 +514,7 @@ var PageView = function pageView(container, id, scale,
|
|||||||
// Use the same hack we use for high dpi displays for printing to get better
|
// Use the same hack we use for high dpi displays for printing to get better
|
||||||
// output until bug 811002 is fixed in FF.
|
// output until bug 811002 is fixed in FF.
|
||||||
var PRINT_OUTPUT_SCALE = 2;
|
var PRINT_OUTPUT_SCALE = 2;
|
||||||
var canvas = this.canvas = document.createElement('canvas');
|
var canvas = document.createElement('canvas');
|
||||||
canvas.width = Math.floor(viewport.width) * PRINT_OUTPUT_SCALE;
|
canvas.width = Math.floor(viewport.width) * PRINT_OUTPUT_SCALE;
|
||||||
canvas.height = Math.floor(viewport.height) * PRINT_OUTPUT_SCALE;
|
canvas.height = Math.floor(viewport.height) * PRINT_OUTPUT_SCALE;
|
||||||
canvas.style.width = (PRINT_OUTPUT_SCALE * viewport.width) + 'pt';
|
canvas.style.width = (PRINT_OUTPUT_SCALE * viewport.width) + 'pt';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user