Skip to content

Commit

Permalink
Fix set hub to closed before closing sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
olahol committed Mar 30, 2024
1 parent 18ed1fe commit b1236e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hub.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,14 @@ loop:
}
})
case m := <-h.exit:
h.open.Store(false)

h.sessions.each(func(s *Session) {
s.writeMessage(m)
s.Close()
})

h.sessions.clear()
h.open.Store(false)

break loop
}
Expand Down

0 comments on commit b1236e7

Please sign in to comment.