From 9998edb255123d1a31ddde0314a270ba19c89e91 Mon Sep 17 00:00:00 2001 From: Takuma Kira Date: Fri, 17 Apr 2020 14:29:19 +0900 Subject: [PATCH] Move TileSource.destroy to the right place. --- src/tiledimage.js | 4 ++++ src/viewer.js | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/tiledimage.js b/src/tiledimage.js index 347a5b3e..cc05cb57 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -326,6 +326,10 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag */ destroy: function() { this.reset(); + + if (this.source.destroy) { + this.source.destroy(); + } }, /** diff --git a/src/viewer.js b/src/viewer.js index 93217150..20e06186 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -742,11 +742,6 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, return; } - //TODO: implement destroy and _freeupCanvasMemory method for all child classes of TileSource, then remove if statement wrap below. - if (this.source.destroy) { - this.source.destroy(); - } - this.close(); this.clearOverlays();