File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -136,17 +136,15 @@ func (c *Call) onDCUnpublish(stop []event.SFUTrackDescription, sdp string) {
136136
137137 newPublishers := []* Publisher {}
138138
139- c .mutex .RLock ()
139+ c .mutex .Lock ()
140140 for _ , publisher := range c .Publishers {
141141 if publisher .Matches (trackDesc ) {
142142 publisher .Stop ()
143143 } else {
144144 newPublishers = append (newPublishers , publisher )
145145 }
146146 }
147- c .mutex .RUnlock ()
148147
149- c .mutex .Lock ()
150148 c .Publishers = newPublishers
151149 c .mutex .Unlock ()
152150 }
@@ -550,15 +548,13 @@ func (c *Call) CheckKeepAliveTimestamp() {
550548func (c * Call ) RemoveSubscriber (toDelete * Subscriber ) {
551549 newSubscribers := []* Subscriber {}
552550
553- c .mutex .RLock ()
551+ c .mutex .Lock ()
554552 for _ , subscriber := range c .Subscribers {
555553 if subscriber != toDelete {
556554 newSubscribers = append (newSubscribers , subscriber )
557555 }
558556 }
559- c .mutex .RUnlock ()
560557
561- c .mutex .Lock ()
562558 c .Subscribers = newSubscribers
563559 c .mutex .Unlock ()
564560}
You can’t perform that action at this time.
0 commit comments