diff --git a/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java b/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java index f231771b61..43973f7986 100644 --- a/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java +++ b/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java @@ -476,11 +476,11 @@ public final class NioEventLoop extends SingleThreadEventLoop { // null out entries in the array to allow to have it GC'ed once the Channel close // See https://github.com/netty/netty/issues/2363 for (;;) { + i++; if (selectedKeys[i] == null) { break; } selectedKeys[i] = null; - i++; } selectAgain();