diff --git a/common/src/main/java/io/netty/util/Recycler.java b/common/src/main/java/io/netty/util/Recycler.java index ba1a0ffbc2..ddaf6a6e89 100644 --- a/common/src/main/java/io/netty/util/Recycler.java +++ b/common/src/main/java/io/netty/util/Recycler.java @@ -462,16 +462,19 @@ public abstract class Recycler { } boolean scavengeSome() { + WeakOrderQueue prev; WeakOrderQueue cursor = this.cursor; if (cursor == null) { + prev = null; cursor = head; if (cursor == null) { return false; } + } else { + prev = this.prev; } boolean success = false; - WeakOrderQueue prev = this.prev; do { if (cursor.transfer(this)) { success = true;