-
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
WeakReference ist sometimes Null in WeakSubscriber #1006
Comments
I'm not sure if this is the same issue described above, but we've seen similar issues where using an anonymous function will result in the subscription being GCed because there is only the WeakReference holding it. The only fix so far is to hold a hard reference to the subscription in the Fragment or Activity (and consequently unsubscribing in ondestroy) which kind of defeats the purpose of OperatorWeakBinding and bindFragment over fromFragment. I'm not sure if there's a good solution since holding a hard ref to the subscription usually means holding a ref indirectly to the fragment as well. |
If I have understood you correctly, they use fromFragment instead bindFragement, but the method is deprecated. |
Isn't this similar to #979? (I think it is, and we should discuss possible solutions there) |
Ah yes, it's the same as 979 in my case. I'm not sure if that's what @markus2610 is also talking about. |
Yes I did mean it. |
I believe this was fixed due to #1021 so closing. If not, please re-open with details on what is left to do. |
I used the method bindFragment () when I go repeatedly from activity A to B back and forth is from and to the weak reference to the Subscriber zero.
The text was updated successfully, but these errors were encountered: