Skip to content

Commit

Permalink
Merge pull request Terry-Mao#309 from iwannay/master
Browse files Browse the repository at this point in the history
修复切房间造成的房间内链表回路
  • Loading branch information
Tony authored Jun 11, 2019
2 parents 2a5ab74 + 364cc69 commit d5d3d0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions internal/comet/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,14 @@ func (b *Bucket) ChangeRoom(nrid string, ch *Channel) (err error) {
b.rooms[nrid] = nroom
}
b.cLock.Unlock()
if oroom != nil && oroom.Del(ch) {
b.DelRoom(oroom)
}

if err = nroom.Put(ch); err != nil {
return
}
ch.Room = nroom
if oroom != nil && oroom.Del(ch) {
b.DelRoom(oroom)
}
return
}

Expand Down

0 comments on commit d5d3d0e

Please sign in to comment.