Skip to content

Commit

Permalink
tcp/udp/dtls: set ctx to nil for released messages in pools
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Sep 17, 2021
1 parent 4a904cb commit 231b8cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tcp/message/pool/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func ReleaseMessage(req *Message) {
}
atomic.AddInt32(&currentMessagesInPool, 1)
req.Reset()
req.ctx = nil
messagePool.Put(req)
}

Expand Down
1 change: 1 addition & 0 deletions udp/message/pool/message.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func ReleaseMessage(req *Message) {
}
atomic.AddInt32(&currentMessagesInPool, 1)
req.Reset()
req.ctx = nil
messagePool.Put(req)
}

Expand Down

0 comments on commit 231b8cd

Please sign in to comment.