ce6931e0e5 buffer leak in EpollSocketChannelTest

Motivation:
ce6931e0e5 introduced a buffer leak in EpollSocketChannelTest.

Modifications:
- Fix buffer leak

Result:
No more buffer leak.
This commit is contained in:
Scott Mitchell 2015-08-21 11:15:10 -07:00
parent ac9ae14bd9
commit a55df36ae4

View File

@ -26,6 +26,7 @@ import io.netty.channel.ChannelOption;
import io.netty.channel.ChannelPipeline; import io.netty.channel.ChannelPipeline;
import io.netty.channel.EventLoopGroup; import io.netty.channel.EventLoopGroup;
import io.netty.channel.ServerChannel; import io.netty.channel.ServerChannel;
import io.netty.util.ReferenceCountUtil;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Test; import org.junit.Test;
@ -182,6 +183,7 @@ public class EpollSocketChannelTest {
private static class BuggyChannelHandler extends ChannelInboundHandlerAdapter { private static class BuggyChannelHandler extends ChannelInboundHandlerAdapter {
@Override @Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
ReferenceCountUtil.release(msg);
throw new NullPointerException("I am a bug!"); throw new NullPointerException("I am a bug!");
} }
} }