Skip to content

Commit e17d828

Browse files
committed
Merge pull request mozilla#1967 from brendandahl/deatched-dom
Cleanup references to dom elements.
2 parents 1d3aba2 + 2ca8c0d commit e17d828

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/canvas.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
12581258
return CanvasGraphics;
12591259
})();
12601260

1261-
if (!isWorker) {
1261+
function checkPutBinaryImageDataCompatibility() {
12621262
// Feature detection if the browser can use an Uint8Array directly as imgData.
12631263
var canvas = document.createElement('canvas');
12641264
canvas.width = 1;
@@ -1293,3 +1293,6 @@ if (!isWorker) {
12931293
};
12941294
}
12951295
}
1296+
if (!isWorker) {
1297+
checkPutBinaryImageDataCompatibility();
1298+
}

web/viewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,6 +1704,7 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) {
17041704
if (textDivs.length === 0) {
17051705
clearInterval(renderTimer);
17061706
renderingDone = true;
1707+
self.textLayerDiv = textLayerDiv = canvas = ctx = null;
17071708
return;
17081709
}
17091710
var textDiv = textDivs.shift();

0 commit comments

Comments
 (0)