Fix resource leak in InternalAttribute.setValue()
This commit is contained in:
parent
eb4ef433c6
commit
5f9854d8ac
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user