From daa58ffe58dad14f486d7fca4d651eb7ed2303d1 Mon Sep 17 00:00:00 2001 From: md_5 Date: Wed, 10 Jul 2013 09:18:58 +1000 Subject: [PATCH] Recycle messagelist when channel goes inactive --- proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java | 2 +- proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java index ca1a78da..74ac909e 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/ChannelWrapper.java @@ -15,7 +15,7 @@ public class ChannelWrapper private final Channel ch; @Getter private volatile boolean closed; - private final MessageList queue = MessageList.newInstance(); + final MessageList queue = MessageList.newInstance(); private volatile boolean flushNow = true; public ChannelWrapper(ChannelHandlerContext ctx) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index ede4ad5c..f784ad5c 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -56,6 +56,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter ProxyServer.getInstance().getLogger().log( Level.INFO, "{0} has disconnected", handler ); } } + channel.queue.recycle(); } @Override