Skip to content

Commit

Permalink
avoid memory leak in LazySet
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Aug 12, 2019
1 parent 5e52f42 commit ada11a2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/util/LazySet.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ class LazySet {
} else {
this._toMerge.add(iterable);
this._needMerge = true;
// Avoid a memory leak
if (this._toMerge.size > 100000) this._merge();
}
return this;
}
Expand Down

0 comments on commit ada11a2

Please sign in to comment.