Skip to content

Commit

Permalink
fix - method Pool.SetSize() may lead memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
darjun committed Jun 10, 2021
1 parent 1b37d6c commit 7457606
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tunny.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ func (p *Pool) SetSize(n int) {
// Synchronously wait for all workers > N to stop
for i := n; i < lWorkers; i++ {
p.workers[i].join()
p.workers[i] = nil
}

// Remove stopped workers from slice
Expand Down

0 comments on commit 7457606

Please sign in to comment.