Skip to content

Commit

Permalink
Merge pull request #73 from wab301/master
Browse files Browse the repository at this point in the history
修复Manager关闭过程中添加Session可能导致关闭过程提前结束的问题
  • Loading branch information
qinlai authored Aug 5, 2019
2 parents bd07e4e + 575da37 commit 9870891
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go

go:
- 1.7
- 1.12.7

install:
- go get -t -v ./...
Expand Down
6 changes: 4 additions & 2 deletions manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ func (manager *Manager) delSession(session *Session) {
smap.Lock()
defer smap.Unlock()

delete(smap.sessions, session.id)
manager.disposeWait.Done()
if _, ok := smap.sessions[session.id]; ok {
delete(smap.sessions, session.id)
manager.disposeWait.Done()
}
}

0 comments on commit 9870891

Please sign in to comment.