From af26fdbff1f630fbd4dd6933880ef5b14249e997 Mon Sep 17 00:00:00 2001 From: pearcetm Date: Wed, 18 May 2022 12:26:19 -0400 Subject: [PATCH] Bugfix for imagetilesource _freeupCanvasMemory --- src/imagetilesource.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/imagetilesource.js b/src/imagetilesource.js index cbea1ef0..6d49bbd3 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -272,8 +272,10 @@ */ _freeupCanvasMemory: function () { for (var i = 0; i < this.levels.length; i++) { - this.levels[i].context2D.canvas.height = 0; - this.levels[i].context2D.canvas.width = 0; + if(this.levels[i].context2D){ + this.levels[i].context2D.canvas.height = 0; + this.levels[i].context2D.canvas.width = 0; + } } }, });