Navigation Menu

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 - Memory leak ContentResolver #176

Merged
merged 4 commits into from Dec 3, 2018
Merged

Fix - Memory leak ContentResolver #176

merged 4 commits into from Dec 3, 2018

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2018

I am using android-image-picker inside an app were we are using leakcanary in debug builds. I received a memory leak warning about the ContentResolver.

The reason is, that the ContentObserver is registered in onStart, but unregistered in onDestroy.

How to reproduce:

  1. Use leakcanary (first commit) and start sample app
  2. Start the image picker
  3. Press back
  4. Start image picker again
  5. You'll see leakcanary dumping the heap

I tested a bit with the sample and it doesn't seem to introduce new bugs.

@esafirm
Copy link
Owner

esafirm commented Dec 3, 2018

@jayearn had to adjust this with the new Fragment structure. Thank you for this PR 🎉

@esafirm esafirm merged commit 8fcc8fd into esafirm:master Dec 3, 2018
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.

None yet

2 participants