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 leaks when unsubscribe functions error #1258

Merged
merged 3 commits into from
Jan 27, 2016
Merged

Fix leaks when unsubscribe functions error #1258

merged 3 commits into from
Jan 27, 2016

Conversation

benlesh
Copy link
Member

@benlesh benlesh commented Jan 27, 2016

Relates to discussion in #1256

Basically this adds a context that is passed around internally that collects all errors and throws them as a group in an UnsubscriptionError when the subscription tree is unsubscribed completely.

@trxcllnt
Copy link
Member

@Blesh I'm all for this PR, but I think if we're going to have special error handling logic to avoid potential memory leaks here, we should be consistent and do it for subscription as well (#1191).

… unsubscribed subscription

- tries to synchronously add a custom subscription that throws when unsubscribed to a Subscription that is mid-unsubscribe and therefor
  flagged `isUnsubscribed`. It's an edge-case, but it should work.

fixes #1256
subscription.unsubscribe();
const sub = _subscriptions[index];
if (isObject(sub)) {
let trial = tryCatch(sub.unsubscribe).call(sub);
Copy link
Member

Choose a reason for hiding this comment

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

@Blesh is there a reason this is let trial instead of const trial? same for above

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope. Sorry I missed this comment in my zeal to merge.

@benlesh benlesh merged commit 9d5a01c into ReactiveX:master Jan 27, 2016
@benlesh
Copy link
Member Author

benlesh commented Jan 28, 2016

@trxcllnt no doubt, I'm just waiting for a rehash of that PR, since I think a lot has changed around that code since you made the PR.

@benlesh benlesh deleted the leak-fix branch April 27, 2016 17:15
@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
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.

2 participants