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 (buf != null && buf.isReadable()) {
|
||||
out.add(buf);
|
||||
buf = null;
|
||||
}
|
||||
out.add(msgs, i, size - i);
|
||||
break;
|
||||
|
@ -110,11 +111,9 @@ public abstract class MessageToByteEncoder<I> extends ChannelOutboundHandlerAdap
|
|||
}
|
||||
}
|
||||
|
||||
if (buf != null) {
|
||||
if (buf.isReadable()) {
|
||||
out.add(buf);
|
||||
buf = null;
|
||||
}
|
||||
if (buf != null && buf.isReadable()) {
|
||||
out.add(buf);
|
||||
buf = null;
|
||||
}
|
||||
|
||||
success = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user