Skip to content

Commit

Permalink
Merge pull request #34 from darjun/master
Browse files Browse the repository at this point in the history
fix - method Pool.SetSize() may lead memory leak
  • Loading branch information
Jeffail authored Jun 11, 2021
2 parents 1b37d6c + 7457606 commit 058073f
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 058073f

Please sign in to comment.