Skip to content

Commit 9f87505

Browse files
cartantbenlesh
authored andcommitted
fix: clear subscription on shareReplay completion (#5044)
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
1 parent 733a673 commit 9f87505

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/internal/operators/shareReplay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ function shareReplayOperator<T>({
102102
},
103103
complete() {
104104
isComplete = true;
105+
subscription = undefined;
105106
subject.complete();
106107
},
107108
});

0 commit comments

Comments
 (0)