Skip to content

Commit

Permalink
Fix memory leak via uncleared setTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Jan 4, 2018
1 parent 2f16075 commit 2bc6a33
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/source/source_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,12 @@ class SourceCache extends Evented {

for (const id in this._tiles)
this._removeTile(id);

for (const id in this._cacheTimers) {
clearTimeout(this._cacheTimers[id]);
delete this._cacheTimers[id];
}

this._cache.reset();
}

Expand Down

0 comments on commit 2bc6a33

Please sign in to comment.