From b4e3e09b76ba033a1c6721066a3d6c3b4d4a91f0 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Thu, 6 Feb 2014 21:00:05 -0800 Subject: [PATCH] Fix a bug that CompositeByteBuf.touch() does nothing --- .../main/java/io/netty/buffer/CompositeByteBuf.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java index a378a00024..d7255361cc 100644 --- a/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/CompositeByteBuf.java @@ -1572,12 +1572,18 @@ public class CompositeByteBuf extends AbstractReferenceCountedByteBuf { @Override public CompositeByteBuf touch() { - return (CompositeByteBuf) super.touch(); + if (leak != null) { + leak.record(); + } + return this; } @Override public CompositeByteBuf touch(Object hint) { - return (CompositeByteBuf) super.touch(hint); + if (leak != null) { + leak.record(hint); + } + return this; } @Override