mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-10-05 13:28:13 +03:00
pool: clear idle state references on acquire
Prevent the idle slice's backing array from retaining discarded states.
This commit is contained in:
@@ -69,6 +69,7 @@ func (p *Pool) Acquire(ctx context.Context) (*glua.LState, error) {
|
||||
n := len(p.idle)
|
||||
if n != 0 {
|
||||
state := p.idle[n-1]
|
||||
p.idle[n-1] = nil
|
||||
p.idle = p.idle[:n-1]
|
||||
p.mu.Unlock()
|
||||
return state, nil
|
||||
|
||||
Reference in New Issue
Block a user