Correctly release message in MemcacheClientHandler that is used in the memcache example. (#8119)

Motivation:

MemcacheClientHandler.channelRead(...) need to release the frame after it prints out its content to not introduce a memory leak.

Modifications:

Call release() on the frame.

Result:

Example has no leak any more.
This commit is contained in:
Norman Maurer 2018-07-11 10:18:18 +01:00 committed by GitHub
parent 7bb9e7eafe
commit 4b9125f961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,6 +69,7 @@ public class MemcacheClientHandler extends ChannelDuplexHandler {
public void channelRead(ChannelHandlerContext ctx, Object msg) {
FullBinaryMemcacheResponse res = (FullBinaryMemcacheResponse) msg;
System.out.println(res.content().toString(CharsetUtil.UTF_8));
res.release();
}
@Override