From 2520d7f6971dbf0025d0ac55617a492ce0f3cda3 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 26 Nov 2024 13:24:30 +0100 Subject: [PATCH] Fix a possible issue introduced with #7799 --- .../io/reactivex/rxjava3/internal/queue/MpscLinkedQueue.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;