fixed unsubscribe bug

This commit is contained in:
Nathan Hack 2021-11-19 21:12:12 -05:00
parent 756e057617
commit 17d055eab2
1 changed files with 1 additions and 3 deletions

View File

@ -1389,14 +1389,12 @@ func (ps *PubSub) unsubscribe(conn Conn, pattern, all bool, channel string) {
}
} else {
// unsubscribe single channel from (p)subscribe.
var entry *pubSubEntry
for ient := range sconn.entries {
if ient.pattern == pattern && ient.channel == channel {
removeEntry(entry)
removeEntry(ient)
break
}
}
removeEntry(entry)
}
sconn.dconn.Flush()
}