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 final Charset charset;
|
||||||
private int size;
|
private int size;
|
||||||
|
|
||||||
public InternalAttribute(Charset charset) {
|
InternalAttribute(Charset charset) {
|
||||||
this.charset = charset;
|
this.charset = charset;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,6 +67,7 @@ final class InternalAttribute extends AbstractReferenceCounted implements Interf
|
|||||||
ByteBuf old = this.value.set(rank, buf);
|
ByteBuf old = this.value.set(rank, buf);
|
||||||
if (old != null) {
|
if (old != null) {
|
||||||
size -= old.readableBytes();
|
size -= old.readableBytes();
|
||||||
|
old.release();
|
||||||
}
|
}
|
||||||
size += buf.readableBytes();
|
size += buf.readableBytes();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user