Skip to content

Commit

Permalink
Fix memory leaks (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cap32 authored and sindresorhus committed Mar 6, 2018
1 parent 6f8bb90 commit e91d91b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ class PQueue {
this.queue.dequeue()();
} else {
this._resolveEmpty();
this._resolveEmpty = () => {};

if (this._pendingCount === 0) {
this._resolveIdle();
this._resolveIdle = () => {};
}
}
}
Expand Down

0 comments on commit e91d91b

Please sign in to comment.