Also record retain() and release()

This commit is contained in:
Trustin Lee 2013-12-06 13:44:59 +09:00
parent 6554b8c395
commit d21568b962

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