From 103f5cbfdb6d430e26c4c1573f18abeed06fb8c4 Mon Sep 17 00:00:00 2001 From: Meo597 <197331664+Meo597@users.noreply.github.com> Date: Mon, 5 Oct 2026 08:37:12 +0800 Subject: [PATCH] pool: clear idle state references on acquire Prevent the idle slice's backing array from retaining discarded states. --- common/lua/pool.go | 1 + 1 file changed, 1 insertion(+) diff --git a/common/lua/pool.go b/common/lua/pool.go index 5457ebcf6..ec9a58906 100644 --- a/common/lua/pool.go +++ b/common/lua/pool.go @@ -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