[#1135] Fix endless loop which will get triggered when an exception is thrown during freeHandlerBuffersAfterRemoval

This commit is contained in:
Norman Maurer 2013-03-08 21:41:47 +01:00
parent b1775a3223
commit 7b4c83b462

View File

@ -99,6 +99,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
private Runnable fireInboundBufferUpdated0Task;
private Runnable invokeChannelReadSuspendedTask;
private Runnable invokeRead0Task;
private boolean freed;
boolean removed;
@SuppressWarnings("unchecked")
@ -350,9 +351,10 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements
}
void freeHandlerBuffersAfterRemoval() {
if (!removed) {
if (!removed || freed) {
return;
}
freed = true;
final ChannelHandler handler = handler();
if (handler instanceof ChannelInboundHandler) {