Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clear subscription on shareReplay completion #5044

Merged
merged 1 commit into from Nov 26, 2019

Conversation

cartant
Copy link
Collaborator

@cartant cartant commented Sep 28, 2019

Description:

In shareReplay, 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.

Using the DevTools, I've verified that the fix in this PR is required, but I have no idea how a test could be written for this sort of thing.

Related issue (if exists): #5034

@gogakoreli
Copy link

Looks good, thanks for the help.

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
Copy link
Member

@benlesh benlesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a test that verifies this is working?

@benlesh benlesh merged commit 35e600f into ReactiveX:master Nov 26, 2019
benlesh pushed a commit that referenced this pull request Nov 26, 2019
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
@lock lock bot locked as resolved and limited conversation to collaborators Dec 26, 2019
@cartant cartant deleted the issue-5034 branch September 24, 2020 07:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants