diff --git a/server/topic.go b/server/topic.go index 7e64de5d1..f438dee57 100644 --- a/server/topic.go +++ b/server/topic.go @@ -720,7 +720,7 @@ func (t *Topic) handleLeaveRequest(msg *ClientComMessage, sess *Session) { // User wants to leave without unsubscribing. if pssd, _ := t.remSession(sess, asUid); pssd != nil { if !sess.isProxy() { - sess.detach <- t.name + sess.delSub(t.name) } if pssd.isChanSub != asChan { // Cannot address non-channel subscription as channel and vice versa. diff --git a/server/topic_proxy.go b/server/topic_proxy.go index 56edf35c3..df547d69d 100644 --- a/server/topic_proxy.go +++ b/server/topic_proxy.go @@ -139,7 +139,7 @@ func (t *Topic) handleProxyLeaveRequest(msg *ClientComMessage, killTimer *time.T // and we won't be able to find and remove it by its sid. pssd, result := t.remSession(msg.sess, asUid) if result { - msg.sess.detach <- t.name + msg.sess.delSub(t.name) } if !msg.init { // Explicitly specify the uid because the master multiplex session needs to know which