diff --git a/src/main/java/io/reactivex/rxjava3/internal/queue/MpscLinkedQueue.java b/src/main/java/io/reactivex/rxjava3/internal/queue/MpscLinkedQueue.java index e8d19c633e..a7f4507821 100644 --- a/src/main/java/io/reactivex/rxjava3/internal/queue/MpscLinkedQueue.java +++ b/src/main/java/io/reactivex/rxjava3/internal/queue/MpscLinkedQueue.java @@ -92,7 +92,7 @@ public T poll() { final T nextValue = nextNode.getAndNullValue(); spConsumerNode(nextNode); // unlink previous consumer to help gc - currConsumerNode.soNext(null); + currConsumerNode.soNext(currConsumerNode); return nextValue; } else if (currConsumerNode != lvProducerNode()) { @@ -104,7 +104,7 @@ else if (currConsumerNode != lvProducerNode()) { final T nextValue = nextNode.getAndNullValue(); spConsumerNode(nextNode); // unlink previous consumer to help gc - currConsumerNode.soNext(null); + currConsumerNode.soNext(currConsumerNode); return nextValue; } return null;