From 764fa3e34aca8e8c69db05665987681a8495795d Mon Sep 17 00:00:00 2001 From: Henri Astre Date: Tue, 17 Jun 2014 17:26:10 -0700 Subject: [PATCH] Fix memory leak while destroying the viewer. --- src/drawer.js | 17 ++++++++- src/mousetracker.js | 3 ++ src/viewer.js | 9 ++++- test/demo/memory_check.html | 71 +++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 test/demo/memory_check.html diff --git a/src/drawer.js b/src/drawer.js index 54b07281..95da18ce 100644 --- a/src/drawer.js +++ b/src/drawer.js @@ -302,7 +302,22 @@ $.Drawer.prototype = /** @lends OpenSeadragon.Drawer.prototype */{ */ canRotate: function() { return this.useCanvas; - } + }, + + /** + * Destroy the drawer (unload current loaded tiles) + */ + destroy: function() { + + //unload current loaded tiles (=empty TILE_CACHE) + for (var i=0; i + + + OpenSeadragon Memory Check Demo + + + + +
+ Simple demo page to monitor OpenSeadragon Memory Usage. +
+ + + +
+ + + \ No newline at end of file