Only listen once for tile events
Assuming browser garbage collection cannot happen while we have listeners in the global registry, we need to listenOnce to avoid memory leaks with the tile queue.
This commit is contained in:
1 parent
83a00c13fa
commit
f5c627ab51
1 file changed
+1
-1
+1
-1
@@ -174,7 +174,7 @@ ol.TileQueue.prototype.loadMoreTiles = function() {
|
||||
var tile;
|
||||
while (this.heap_.length > 0 && this.tilesLoading_ < this.maxTilesLoading_) {
|
||||
tile = /** @type {ol.Tile} */ (this.dequeue_());
|
||||
goog.events.listen(tile, goog.events.EventType.CHANGE,
|
||||
goog.events.listenOnce(tile, goog.events.EventType.CHANGE,
|
||||
this.handleTileChange, false, this);
|
||||
tile.load();
|
||||
++this.tilesLoading_;
|
||||
|
||||
Reference in new issue
Block a user