Skip to content

Commit

Permalink
fix: clear subscription on shareReplay completion
Browse files Browse the repository at this point in the history
The subscription needs to be cleared to prevent the implementation holding a reference to the completed source. In Angular, not clearing the reference can lead to components not being garbage collected.

Closes ReactiveX#5034
  • Loading branch information
gogakoreli authored and cartant committed Sep 28, 2019
1 parent b713d39 commit 1e9c9c7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/internal/operators/shareReplay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ function shareReplayOperator<T>({
},
complete() {
isComplete = true;
subscription = undefined;
subject.complete();
},
});
Expand Down

0 comments on commit 1e9c9c7

Please sign in to comment.