diff --git a/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java b/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java index 0968c33549..5ce3350871 100644 --- a/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/ByteToMessageDecoder.java @@ -212,6 +212,7 @@ public abstract class ByteToMessageDecoder extends ChannelInboundHandlerAdapter ctx.fireChannelRead(out.get(i)); } ctx.fireChannelInactive(); + out.recycle(); } } diff --git a/codec/src/main/java/io/netty/handler/codec/ReplayingDecoder.java b/codec/src/main/java/io/netty/handler/codec/ReplayingDecoder.java index 74248d1202..4f8e90a24c 100644 --- a/codec/src/main/java/io/netty/handler/codec/ReplayingDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/ReplayingDecoder.java @@ -345,6 +345,7 @@ public abstract class ReplayingDecoder extends ByteToMessageDecoder { ctx.fireChannelRead(out.get(i)); } ctx.fireChannelInactive(); + out.recycle(); } }