Move TileSource.destroy to the right place.

This commit is contained in:
Takuma Kira 2020-04-17 14:29:19 +09:00
parent c2ed66415f
commit 9998edb255
2 changed files with 4 additions and 5 deletions

View File

@ -326,6 +326,10 @@ $.extend($.TiledImage.prototype, $.EventSource.prototype, /** @lends OpenSeadrag
*/
destroy: function() {
this.reset();
if (this.source.destroy) {
this.source.destroy();
}
},
/**

View File

@ -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();