Skip to content

Commit

Permalink
fix: clear subscription on shareReplay completion (#5044)
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 #5034
  • Loading branch information
cartant authored and benlesh committed Nov 26, 2019
1 parent 733a673 commit 9f87505
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 9f87505

Please sign in to comment.