-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Reference leak via SafeSubscriber.actual? #3074
Comments
If the actual leaks it means the Subscriber leaks because it is retained somewhere outside the library. Otherwise, it provides performance benefits and avoids null checks. |
I was holding a reference to the Subscription, but it had been unsubscribed. Nulling that reference allowed the Subscriber to be collected. I suppose it was naive to expect that unsubscribing a Subscription would release internal references, but there's no indication in the API how Subscription behaves with respect to references, or how a user should manage them to avoid leaks. It also appears to be inconsistent, unless I'm misreading (entirely possible): SubscriptionList and CompositeSubscription, for instance, do appear to release references to their member Subscriptions when unsubscribed. |
I also faced this undocumented behaviour, now I release my Subscribtion references or use a SubscriptionList |
Any move on this issue? |
Does this issue only involve SafeSubscriber ? |
Is there any reason for SafeSubscriber to retain
actual
afterunsubscribe()
? I'm seeing a reference leak through the actual subscriber, and it looks like it should probably be broken by dropping that reference.The text was updated successfully, but these errors were encountered: