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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf retain() {
|
||||
leak.record();
|
||||
return super.retain();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuf retain(int increment) {
|
||||
leak.record();
|
||||
return super.retain(increment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean release() {
|
||||
boolean deallocated = super.release();
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else{
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
@ -685,6 +699,8 @@ final class AdvancedLeakAwareByteBuf extends WrappedByteBuf {
|
||||
boolean deallocated = super.release(decrement);
|
||||
if (deallocated) {
|
||||
leak.close();
|
||||
} else {
|
||||
leak.record();
|
||||
}
|
||||
return deallocated;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user