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

nulling the reference to the activity in onDetach to avoid leaks #99

Closed
wants to merge 1 commit into from
Closed

nulling the reference to the activity in onDetach to avoid leaks #99

wants to merge 1 commit into from

Conversation

demoritas
Copy link

If a Fragment is detached all references to the detaching activity should be removed, this PR sets the userListListener of the UserListFragment to null in onDetach()

@spirosoik
Copy link

👍 Nice gotcha @demoritas. By the way I think that this can be resolved with this lib also https://github.com/trello/RxLifecycle

@demoritas
Copy link
Author

Actually I am not sure.
It seems RXLifeCycle calls automatically onCompleted but does not free the subscriber

@demoritas
Copy link
Author

rxlifecycle_debug_activity

@demoritas
Copy link
Author

rxlifecycle_changed_main

@demoritas
Copy link
Author

maybe I'm calling RX wrong or made another error (I'm fairly new to RX) also leakcanary does not show a leak which is strange since the activity does show up in the debugger.

@android10
Copy link
Owner

I added this line manually since I was solving all the fixes. Closing the PR and thanks again for the contributions.

@android10 android10 closed this Jan 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants