Simplify a bit

This commit is contained in:
Norman Maurer 2013-04-30 07:17:07 +02:00
parent 4bac0443e8
commit 61327b5871

View File

@ -16,9 +16,9 @@
package io.netty.channel; package io.netty.channel;
import io.netty.buffer.Buf; import io.netty.buffer.Buf;
import io.netty.buffer.BufUtil;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.MessageBuf; import io.netty.buffer.MessageBuf;
import io.netty.buffer.ReferenceCounted;
import io.netty.buffer.Unpooled; import io.netty.buffer.Unpooled;
import io.netty.channel.Channel.Unsafe; import io.netty.channel.Channel.Unsafe;
import io.netty.util.concurrent.EventExecutor; import io.netty.util.concurrent.EventExecutor;
@ -1029,10 +1029,7 @@ final class DefaultChannelPipeline implements ChannelPipeline {
if (m == null) { if (m == null) {
break; break;
} }
BufUtil.release(m);
if (m instanceof ReferenceCounted) {
((ReferenceCounted) m).release();
}
logger.debug( logger.debug(
"Discarded inbound message {} that reached at the tail of the pipeline. " + "Discarded inbound message {} that reached at the tail of the pipeline. " +
"Please check your pipeline configuration.", m); "Please check your pipeline configuration.", m);
@ -1159,9 +1156,7 @@ final class DefaultChannelPipeline implements ChannelPipeline {
discardedMessages ++; discardedMessages ++;
} }
if (m instanceof ReferenceCounted) { BufUtil.release(m);
((ReferenceCounted) m).release();
}
} }
if (discardedMessages != 0) { if (discardedMessages != 0) {