diff --git a/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareByteBuf.java b/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareByteBuf.java index 3b08f85120..5fb13c214e 100644 --- a/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareByteBuf.java @@ -931,6 +931,18 @@ final class AdvancedLeakAwareByteBuf extends SimpleLeakAwareByteBuf { return super.retain(increment); } + @Override + public boolean release() { + leak.record(); + return super.release(); + } + + @Override + public boolean release(int decrement) { + leak.record(); + return super.release(decrement); + } + @Override public ByteBuf touch() { leak.record(); diff --git a/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareCompositeByteBuf.java b/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareCompositeByteBuf.java index 1c9155fcbd..ff93de665c 100644 --- a/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareCompositeByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/AdvancedLeakAwareCompositeByteBuf.java @@ -1017,6 +1017,18 @@ final class AdvancedLeakAwareCompositeByteBuf extends SimpleLeakAwareCompositeBy return super.retain(increment); } + @Override + public boolean release() { + leak.record(); + return super.release(); + } + + @Override + public boolean release(int decrement) { + leak.record(); + return super.release(decrement); + } + @Override public CompositeByteBuf touch() { leak.record(); diff --git a/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareByteBuf.java b/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareByteBuf.java index 1a8b0bd56c..e07171258a 100644 --- a/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareByteBuf.java @@ -98,7 +98,7 @@ class SimpleLeakAwareByteBuf extends WrappedByteBuf { } @Override - public final boolean release() { + public boolean release() { if (super.release()) { closeLeak(); return true; @@ -107,7 +107,7 @@ class SimpleLeakAwareByteBuf extends WrappedByteBuf { } @Override - public final boolean release(int decrement) { + public boolean release(int decrement) { if (super.release(decrement)) { closeLeak(); return true; diff --git a/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareCompositeByteBuf.java b/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareCompositeByteBuf.java index fda06fdf8a..d96f35c0c5 100644 --- a/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareCompositeByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/SimpleLeakAwareCompositeByteBuf.java @@ -31,7 +31,7 @@ class SimpleLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf { } @Override - public final boolean release() { + public boolean release() { // Call unwrap() before just in case that super.release() will change the ByteBuf instance that is returned // by unwrap(). ByteBuf unwrapped = unwrap(); @@ -43,7 +43,7 @@ class SimpleLeakAwareCompositeByteBuf extends WrappedCompositeByteBuf { } @Override - public final boolean release(int decrement) { + public boolean release(int decrement) { // Call unwrap() before just in case that super.release() will change the ByteBuf instance that is returned // by unwrap(). ByteBuf unwrapped = unwrap();