-
Notifications
You must be signed in to change notification settings - Fork 1.3k
getAdapter() in CategoryImagesListFragment now returns the instance o… #1792
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
getAdapter() in CategoryImagesListFragment now returns the instance o… #1792
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1792 +/- ##
=========================================
+ Coverage 3.56% 3.57% +<.01%
=========================================
Files 186 190 +4
Lines 9329 9501 +172
Branches 811 839 +28
=========================================
+ Hits 333 340 +7
- Misses 8974 9138 +164
- Partials 22 23 +1
Continue to review full report at Codecov.
|
|
@neslihanturan @maskaravivek Hi guys, can you please review it. |
|
@ashishkumar468 Can you use leak canary to verify if your change has actually fixed the leak or not. All you would need to do is:
|
|
@maskaravivek Sure, will update once done |
|
@ashishkumar468 did you have time to test with leak canary? |
|
@neslihanturan Sure I will do it today. Sorry for the delay. |
|
Up:) |
|
Hi @neslihanturan I actually tried to verify the leak by visiting CategoryDetailsActivity multiple times, the build created using this pull request did not actually lead to leaks. It will be great if someone else also verifies |
1f69c9d to
58fe52d
Compare
|
Rebasing... |
|
I could not reproduce the memory leak in 24a76b1 so cannot say for sure it is gone. However, having read through The null checks were added by in #1918 by @henrique-gb. Would likely be useful to get your input on this but I think this should avoid NPEs. |
|
Tested Automated tests pass |
…f the adapter instead of the gridview itself [Issue#1722]
Memory leak in CategoryDetailsActivity
Fixes #1722 [1.5 MB memory leak in CategoryDetailsActivity]
Description (required)
Fixes #1722 [1.5 MB memory leak in CategoryDetailsActivity]
In order to access the media displayed in CategoryImagesListFragment, the getAdapter() function in CategoryImagesListFragment used to return gridView.getAdapter(). I have replaced that with return gridAdapter.Holding a reference of a ui element for accessing a dao object has never been recommended. Hope this solves the leak to some extent.
Tests performed (required)
Tested on {27 & google pixel emulator}, with {build variant, betaDebug}.
Screenshots showing what changed (optional)
NA
Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.