mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-11-22 13:16:10 +03:00
- Add freeupCanvasMemory method on Viewer.destroy method.
This commit is contained in:
parent
abc11e3eb6
commit
798e49e4b2
@ -195,6 +195,18 @@
|
||||
}
|
||||
return context;
|
||||
},
|
||||
/**
|
||||
* Free up canvas memory
|
||||
* (iOS 12 or higher on 2GB RAM device has only 224MB canvas memory,
|
||||
* and Safari keeps canvas until its height and width will be set to 0).
|
||||
* @function
|
||||
*/
|
||||
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;
|
||||
}
|
||||
},
|
||||
|
||||
// private
|
||||
//
|
||||
|
@ -742,6 +742,10 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype,
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.source.freeupCanvasMemory) {
|
||||
this.source.freeupCanvasMemory();
|
||||
}
|
||||
|
||||
this.close();
|
||||
|
||||
this.clearOverlays();
|
||||
|
Loading…
Reference in New Issue
Block a user