[#1136] Fix possible IllegalBufferAccessException when remove itself from the pipeline

This commit is contained in:
Norman Maurer 2013-03-08 21:55:36 +01:00
parent 7b4c83b462
commit fcd6becad9

View File

@ -949,14 +949,16 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
} catch (Throwable t) {
notifyHandlerException(t);
} finally {
if (handler instanceof ChannelInboundByteHandler && !pipeline.isInboundShutdown()) {
try {
((ChannelInboundByteHandler) handler).discardInboundReadBytes(this);
} catch (Throwable t) {
notifyHandlerException(t);
if (!freed) {
if (handler instanceof ChannelInboundByteHandler && !pipeline.isInboundShutdown()) {
try {
((ChannelInboundByteHandler) handler).discardInboundReadBytes(this);
} catch (Throwable t) {
notifyHandlerException(t);
}
}
freeHandlerBuffersAfterRemoval();
}
freeHandlerBuffersAfterRemoval();
}
}
} else {