Skip to content

Commit

Permalink
fix: panic: send on closed channel
Browse files Browse the repository at this point in the history
Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed May 12, 2022
1 parent 65a5155 commit d4b8ad7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ func userLoginAck(code int, c client.Client) {
func (u *user) readLoop() {
defer func() {
u.br.unregister <- u
u.conn.Close()
}()

for {
Expand All @@ -94,7 +93,7 @@ func (u *user) writeLoop() {

defer func() {
ticker.Stop()
u.conn.Close()
u.br.unregister <- u
}()

for {
Expand Down

0 comments on commit d4b8ad7

Please sign in to comment.