Also record retain() and release()

This commit is contained in:
Trustin Lee 2013-12-06 13:44:59 +09:00
parent 04a2249814
commit 5d39b1fc3d

View File

@ -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;
}