Fix memory leak
This commit is contained in:
parent
a0c082497a
commit
30bfb989c1
|
@ -80,6 +80,7 @@ public abstract class MessageToByteEncoder<I> extends ChannelOutboundHandlerAdap
|
||||||
if (ctx.isRemoved()) {
|
if (ctx.isRemoved()) {
|
||||||
if (buf != null && buf.isReadable()) {
|
if (buf != null && buf.isReadable()) {
|
||||||
out.add(buf);
|
out.add(buf);
|
||||||
|
buf = null;
|
||||||
}
|
}
|
||||||
out.add(msgs, i, size - i);
|
out.add(msgs, i, size - i);
|
||||||
break;
|
break;
|
||||||
|
@ -110,11 +111,9 @@ public abstract class MessageToByteEncoder<I> extends ChannelOutboundHandlerAdap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (buf != null) {
|
if (buf != null && buf.isReadable()) {
|
||||||
if (buf.isReadable()) {
|
out.add(buf);
|
||||||
out.add(buf);
|
buf = null;
|
||||||
buf = null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
success = true;
|
success = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user