move the close outside

This commit is contained in:
Daisuke Maki 2026-02-17 07:49:27 +09:00
parent cfc3736e8e
commit 2f0d21d047

View file

@ -277,8 +277,8 @@ func (t *TcellScreen) PollEvent(ctx context.Context, cfg *Config) chan Event {
if r := recover(); r != nil {
fmt.Fprintf(t.errWriter, "peco: panic in PollEvent goroutine: %v\n%s", r, debug.Stack())
}
close(evCh)
}()
defer func() { close(evCh) }()
for {
t.mutex.Lock()