Ensure BufUtil.release() is called even if writeBytes() fails in writeAndRelease()
This commit is contained in:
parent
015e60b00f
commit
03955428bc
@ -167,7 +167,10 @@ final class OutputMessageBuf extends DefaultMessageBuf<Object> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void writeAndRelease(ByteBuf dst, ByteBuf src) {
|
private static void writeAndRelease(ByteBuf dst, ByteBuf src) {
|
||||||
|
try {
|
||||||
dst.writeBytes(src, src.readerIndex(), src.readableBytes());
|
dst.writeBytes(src, src.readerIndex(), src.readableBytes());
|
||||||
|
} finally {
|
||||||
BufUtil.release(src);
|
BufUtil.release(src);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user