mirror of
https://github.com/jech/galene.git
synced 2024-12-22 23:35:46 +01:00
Don't add duplicates in addLocal.
This commit is contained in:
parent
9575b80893
commit
2a35f4e5d9
1 changed files with 6 additions and 0 deletions
6
group.go
6
group.go
|
@ -52,6 +52,12 @@ func (up *upTrack) notifyLocal() {
|
|||
|
||||
func (up *upTrack) addLocal(local *downTrack) {
|
||||
up.mu.Lock()
|
||||
for _, t := range up.local {
|
||||
if t == local {
|
||||
up.mu.Unlock()
|
||||
return
|
||||
}
|
||||
}
|
||||
up.local = append(up.local, local)
|
||||
up.mu.Unlock()
|
||||
up.notifyLocal()
|
||||
|
|
Loading…
Reference in a new issue