mirror of
https://github.com/jech/galene.git
synced 2024-11-26 02:25:58 +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) {
|
func (up *upTrack) addLocal(local *downTrack) {
|
||||||
up.mu.Lock()
|
up.mu.Lock()
|
||||||
|
for _, t := range up.local {
|
||||||
|
if t == local {
|
||||||
|
up.mu.Unlock()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
up.local = append(up.local, local)
|
up.local = append(up.local, local)
|
||||||
up.mu.Unlock()
|
up.mu.Unlock()
|
||||||
up.notifyLocal()
|
up.notifyLocal()
|
||||||
|
|
Loading…
Reference in a new issue