Fix resource leak in InternalAttribute.setValue()

This commit is contained in:
Trustin Lee 2014-01-19 16:51:31 +09:00
parent eb4ef433c6
commit 5f9854d8ac

View File

@ -32,7 +32,7 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf
private final Charset charset;
private int size;
public InternalAttribute(Charset charset) {
InternalAttribute(Charset charset) {
this.charset = charset;
}
@ -67,6 +67,7 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf
ByteBuf old = this.value.set(rank, buf);
if (old != null) {
size -= old.readableBytes();
old.release();
}
size += buf.readableBytes();
}