Skip to content

Commit

Permalink
cancel transceivable.go context when closing is called
Browse files Browse the repository at this point in the history
  • Loading branch information
laduchesneau committed Sep 4, 2024
1 parent 0dcdeb9 commit aa97da7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions transceivable.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ func (t *transceivable) windowCleanup() {

func (t *transceivable) closing(state State) {
if atomic.CompareAndSwapInt32(&t.aliveState, Alive, Closed) {
t.cancel()

t.in.closing(StoppingProcessOnly)
t.out.closing(StoppingProcessOnly)

Expand All @@ -187,6 +189,7 @@ func (t *transceivable) closing(state State) {
if t.settings.OnClosed != nil {
t.settings.OnClosed(state)
}
t.wg.Wait()
}
return

Check failure on line 194 in transceivable.go

View workflow job for this annotation

GitHub Actions / Build

S1023: redundant `return` statement (gosimple)
}

0 comments on commit aa97da7

Please sign in to comment.