Skip to content

Commit

Permalink
Remove close of datachan
Browse files Browse the repository at this point in the history
Closing of the dataChan right after the closeChan can cause a race in select statements.
If select attemps the dataChan operation then a panic will happen.
Since dataChan is not used for synchronization, the closure of closeChan is enough to stop all data operations.

Fixes #60

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
  • Loading branch information
dmcgowan committed Dec 4, 2015
1 parent 0dd8231 commit 593dba5
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,5 @@ func (s *Stream) closeRemoteChannels() {
close(s.closeChan)
s.dataLock.Lock()
defer s.dataLock.Unlock()
close(s.dataChan)
}
}

0 comments on commit 593dba5

Please sign in to comment.