Also record retain() and release()
This commit is contained in:
parent
6554b8c395
commit
d21568b962
@ -671,11 +671,25 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
|||||||
return super.toString(index, length, charset);
|
return super.toString(index, length, charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ByteBuf retain() {
|
||||||
|
leak.record();
|
||||||
|
return super.retain();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ByteBuf retain(int increment) {
|
||||||
|
leak.record();
|
||||||
|
return super.retain(increment);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean release() {
|
public boolean release() {
|
||||||
boolean deallocated = super.release();
|
boolean deallocated = super.release();
|
||||||
if (deallocated) {
|
if (deallocated) {
|
||||||
leak.close();
|
leak.close();
|
||||||
|
} else{
|
||||||
|
leak.record();
|
||||||
}
|
}
|
||||||
return deallocated;
|
return deallocated;
|
||||||
}
|
}
|
||||||
@ -685,6 +699,8 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
|||||||
boolean deallocated = super.release(decrement);
|
boolean deallocated = super.release(decrement);
|
||||||
if (deallocated) {
|
if (deallocated) {
|
||||||
leak.close();
|
leak.close();
|
||||||
|
} else {
|
||||||
|
leak.record();
|
||||||
}
|
}
|
||||||
return deallocated;
|
return deallocated;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user