diff --git a/tea.go b/tea.go index d6a19d5..995299e 100644 --- a/tea.go +++ b/tea.go @@ -442,7 +442,6 @@ func (p *Program) Run() (Model, error) { if err := p.initCancelReader(); err != nil { return model, err } - defer p.cancelReader.Close() //nolint:errcheck } // Handle resize events. @@ -468,6 +467,7 @@ func (p *Program) Run() (Model, error) { if p.cancelReader.Cancel() { p.waitForReadLoop() } + _ = p.cancelReader.Close() // Wait for all handlers to finish. handlers.shutdown()