diff --git a/node/node.go b/node/node.go index 8a5f4cb0..80f12355 100644 --- a/node/node.go +++ b/node/node.go @@ -696,6 +696,10 @@ func (n *Node) Disconnect(s *Session) error { } if n.IsShuttingDown() { + // Make sure session is removed from hub, so we don't try to send + // broadcast messages to them + n.hub.RemoveSession(s) + if s.IsDisconnectable() { return n.DisconnectNow(s) }