From a06a6cb744624553ebcf2505ddcb295eabffbf33 Mon Sep 17 00:00:00 2001 From: langhuihui <178529795@qq.com> Date: Thu, 24 Oct 2024 17:54:45 +0800 Subject: [PATCH] fix: alias auto remove --- publisher.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/publisher.go b/publisher.go index 89f488e..a999a41 100644 --- a/publisher.go +++ b/publisher.go @@ -575,13 +575,13 @@ func (p *Publisher) Dispose() { p.Paused.Reject(p.StopReason()) } for alias := range s.AliasStreams.Range { - if alias.Alias == p.StreamPath { + if alias.StreamPath == p.StreamPath { if alias.AutoRemove { s.AliasStreams.Remove(alias) } for subscriber := range p.SubscriberRange { - if subscriber.StreamPath == alias.StreamPath { - if originStream, ok := s.Streams.Get(alias.StreamPath); ok { + if subscriber.StreamPath == alias.Alias { + if originStream, ok := s.Streams.Get(alias.Alias); ok { p.Subscribers.Remove(subscriber) originStream.AddSubscriber(subscriber) }