Skip to content

Commit 24dcc2a

Browse files
committed
Fix memory leak in bounded ReplaySubject due to retaining the node index
indefinitely once the Subscriber caught up.
1 parent a39ad0c commit 24dcc2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/rx/subjects/ReplaySubject.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import rx.exceptions.Exceptions;
2727
import rx.functions.Action1;
2828
import rx.functions.Func1;
29-
import rx.functions.Functions;
3029
import rx.internal.operators.NotificationLite;
3130
import rx.internal.util.UtilityFunctions;
3231
import rx.schedulers.Timestamped;
@@ -358,6 +357,7 @@ private boolean caughtUp(SubjectObserver<? super T> o) {
358357
if (!o.caughtUp) {
359358
o.caughtUp = true;
360359
state.replayObserver(o);
360+
o.index(null); // once caught up, no need for the index anymore
361361
return false;
362362
} else {
363363
// it was caught up so proceed the "raw route"

0 commit comments

Comments
 (0)