Close encoder when handlerRemoved. (#9950)
Motivation: We should close encoder when `LzfEncoder` was removed from pipeline. Modification: call `encoder.close` when `handlerRemoved` triggered. Result: Close encoder to release internal buffer.
This commit is contained in:
parent
727f03755c
commit
de690daccc
@ -137,4 +137,10 @@ public class LzfEncoder extends MessageToByteEncoder<ByteBuf> {
|
||||
recycler.releaseInputBuffer(input);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handlerRemoved(ChannelHandlerContext ctx) throws Exception {
|
||||
encoder.close();
|
||||
super.handlerRemoved(ctx);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user