From 95584f5c34d9821577c5797c86bf1b4ade9c3406 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 4 Feb 2009 04:05:29 +0000 Subject: [PATCH] Forgot to close the channel --- .../java/org/jboss/netty/channel/socket/nio/NioWorker.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java index 93c0ac02dc..b333c498dd 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioWorker.java @@ -635,6 +635,7 @@ class NioWorker implements Runnable { if (future != null) { future.setFailure(new ClosedChannelException()); } + close(channel, channel.getSucceededFuture()); return; } @@ -644,7 +645,10 @@ class NioWorker implements Runnable { future.setSuccess(); } } catch (ClosedChannelException e) { - future.setFailure(e); + if (future != null) { + future.setFailure(e); + } + close(channel, channel.getSucceededFuture()); throw new ChannelException( "Failed to register a socket to the selector.", e); }