From 159853d7c369a67ef533e29a75e2a84b9cc5aa14 Mon Sep 17 00:00:00 2001 From: delthas Date: Sat, 26 Feb 2022 20:59:46 +0100 Subject: Drain the events channel when closing This avoids rare cases where we try to send messages to the event channel, but it is full and blocks the Close routine. --- app.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app.go b/app.go index 485521f..3b34bd8 100644 --- a/app.go +++ b/app.go @@ -241,6 +241,11 @@ func (app *App) eventLoop() { app.win.Draw(currentMembers) } } + go func() { + // drain events until we close + for range app.events { + } + }() } // ircLoop maintains a connection to the IRC server by connecting and then -- cgit v1.2.3