make other threads exit if there's an error in one

This commit is contained in:
ugjka 2016-11-26 13:51:12 +02:00
parent 9fa6da3c5c
commit f4980d9fc2

1
irc.go
View File

@ -198,6 +198,7 @@ func (irc *Connection) Loop() {
errChan := irc.ErrorChan() errChan := irc.ErrorChan()
for !irc.isQuitting() { for !irc.isQuitting() {
err := <-errChan err := <-errChan
close(irc.end)
irc.Wait() irc.Wait()
for !irc.isQuitting() { for !irc.isQuitting() {
irc.Log.Printf("Error, disconnected: %s\n", err) irc.Log.Printf("Error, disconnected: %s\n", err)