Skip to content

fix: clear subscription on shareReplay completion#5044

Merged
benlesh merged 1 commit intoReactiveX:masterfrom
cartant:issue-5034
Nov 26, 2019
Merged

fix: clear subscription on shareReplay completion#5044
benlesh merged 1 commit intoReactiveX:masterfrom
cartant:issue-5034

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.

3 participants