diff --git a/src/utilities/LRUCache.js b/src/utilities/LRUCache.js index 6a60ddd5..f84e1306 100644 --- a/src/utilities/LRUCache.js +++ b/src/utilities/LRUCache.js @@ -207,12 +207,6 @@ class LRUCache { markAllUnused() { this.usedSet.clear(); - if ( this.unloadingHandle !== - 1 ) { - - cancelAnimationFrame( this.unloadingHandle ); - this.unloadingHandle = - 1; - - } } @@ -364,6 +358,8 @@ class LRUCache { scheduleUnload() { + cancelAnimationFrame( this.unloadingHandle ); + if ( ! this.scheduled ) { this.scheduled = true;