From aad1070633ca294d6525f72a8e94a3a5cfcf4ac3 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Fri, 24 Mar 2017 21:54:06 +1000 Subject: [PATCH] client: Unlock channel mutex earlier --- irc/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/irc/client.go b/irc/client.go index 7ae05696..619b5480 100644 --- a/irc/client.go +++ b/irc/client.go @@ -332,7 +332,6 @@ func (client *Client) Friends(Capabilities ...Capability) ClientSet { for channel := range client.channels { channel.membersMutex.RLock() - defer channel.membersMutex.RUnlock() for member := range channel.members { // make sure they have all the required caps for _, Cap := range Capabilities { @@ -342,6 +341,7 @@ func (client *Client) Friends(Capabilities ...Capability) ClientSet { } friends.Add(member) } + channel.membersMutex.RUnlock() } return friends }