Skip to content

Commit 41b4417

Browse files
committed
Use defer
Signed-off-by: Šimon Brandner <[email protected]>
1 parent f05db80 commit 41b4417

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/subscriber.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ func NewSubscriber(call *Call) *Subscriber {
4848

4949
func (s *Subscriber) initLoggingWithTrack(track *webrtc.TrackRemote) {
5050
s.mutex.Lock()
51+
defer s.mutex.Unlock()
5152
s.logger = s.call.logger.WithFields(logrus.Fields{
5253
"track_id": (*track).ID(),
5354
"track_kind": (*track).Kind(),
5455
"stream_id": (*track).StreamID(),
5556
})
56-
s.mutex.Unlock()
5757
}
5858

5959
func (s *Subscriber) Subscribe(publisher *Publisher) {

0 commit comments

Comments
 (0)