Fix memory leak

This commit is contained in:
creeper123123321 2018-07-28 17:53:17 -03:00
parent 73ee2498e8
commit b1e8efb00b
No known key found for this signature in database
GPG Key ID: 0AC57D54786721D1

View File

@ -69,9 +69,13 @@ public class BungeeEncodeHandler extends MessageToMessageEncoder<ByteBuf> {
}
if (needsCompress) {
ByteBuf old = bytebuf;
bytebuf = BungeePipelineUtil.compress(ctx, bytebuf);
old.release();
out.add(bytebuf);
} else {
out.add(bytebuf.retain());
}
out.add(bytebuf.retain());
}
@Override