Fix lua pool pruning

This commit is contained in:
Alex Roitman 2019-08-01 11:55:52 -07:00
parent 6e98f52769
commit b9e2c67933
1 changed files with 1 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func (pl *lStatePool) Prune() {
newSaved := make([]*lua.LState, n-dropNum) newSaved := make([]*lua.LState, n-dropNum)
copy(newSaved, pl.saved[dropNum:]) copy(newSaved, pl.saved[dropNum:])
pl.saved = newSaved pl.saved = newSaved
pl.total -= dropNum
} }
pl.m.Unlock() pl.m.Unlock()
} }