From 2f6e17f6817d2f122c9b5f3eb94b4cb28bd3179e Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 3 Jan 2013 22:49:54 +0100 Subject: [PATCH] Make sure we catch UnsupportedOperationException for derived buffers --- .../src/main/java/io/netty/channel/ChannelHandlerUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelHandlerUtil.java b/transport/src/main/java/io/netty/channel/ChannelHandlerUtil.java index d4b5582503..27181cc004 100644 --- a/transport/src/main/java/io/netty/channel/ChannelHandlerUtil.java +++ b/transport/src/main/java/io/netty/channel/ChannelHandlerUtil.java @@ -173,7 +173,12 @@ public final class ChannelHandlerUtil { */ public static void freeMessage(Object msg) throws Exception { if (msg instanceof Freeable) { - ((Freeable) msg).free(); + try { + ((Freeable) msg).free(); + } catch (UnsupportedOperationException e) { + // This can happen for derived buffers + // TODO: Think about this + } } }