Fix memory leak

This commit is contained in:
Trustin Lee 2013-06-14 10:44:22 +09:00
parent a0c082497a
commit 30bfb989c1

View File

@ -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;