Also record retain() and release()
This commit is contained in:
parent
0ff98c98e2
commit
26fc84529f
@ -36,28 +36,6 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
||||
this.leak = leak;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean release() {
|
||||
boolean deallocated = super.release();
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else {
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean release(int decrement) {
|
||||
boolean deallocated = super.release(decrement);
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else {
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf order(ByteOrder endianness) {
|
||||
leak.record();
|
||||
@ -704,6 +682,12 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
||||
return super.toString(index, length, charset);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf capacity(int newCapacity) {
|
||||
leak.record();
|
||||
return super.capacity(newCapacity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf retain() {
|
||||
leak.record();
|
||||
@ -717,8 +701,24 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf capacity(int newCapacity) {
|
||||
leak.record();
|
||||
return super.capacity(newCapacity);
|
||||
public boolean release() {
|
||||
boolean deallocated = super.release();
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else{
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean release(int decrement) {
|
||||
boolean deallocated = super.release(decrement);
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else {
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user