Skip to content

Commit

Permalink
Fix memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
kciesielski committed Mar 27, 2024
1 parent b4e7192 commit 83fa2f8
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ class NettyControlFrameHandler(ignorePong: Boolean, autoPongOnPing: Boolean, dec
case ping: PingWebSocketFrame =>
if (autoPongOnPing) {
val _ = ctx.writeAndFlush(new PongWebSocketFrame(ping.content().retain()))
} else {
val _ = ping.content().release()
}
case pong: PongWebSocketFrame =>
case pong: PongWebSocketFrame =>
if (!ignorePong) {
val _ = ctx.fireChannelRead(pong)
} else {
val _ = pong.content().release()
}
case close: CloseWebSocketFrame =>
if (decodeCloseRequests) {
Expand Down

0 comments on commit 83fa2f8

Please sign in to comment.