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

StrongReference of AsyncTask #25

Open
pangeneral opened this issue Aug 13, 2019 · 3 comments
Open

StrongReference of AsyncTask #25

pangeneral opened this issue Aug 13, 2019 · 3 comments

Comments

@pangeneral
Copy link

au.com.wallaceit.reddinator.activity.ViewAllSubredditsActivity.DLTask is an inner class of au.com.wallaceit.reddinator.activity.ViewAllSubredditsActivity, which means The AsyncTask class holds strong reference to the Activity. In other words, there is a potential memory leak danger.
I think DLTask should be changed to a static class or outter class. Thank you.

@micwallace
Copy link
Owner

I may be wrong but since the class is initialized into an object it doesn't matter that it's an inner class. Just like before, once the async task ends then it's object will be disposed. If the activity is disposed before that it is also fine.

Are you new to Java by any chance? You sound like a C programmer :-D

If you are interesting in contributing to the project I can send you a few stack traces from the Play console. I haven't had much time to work on this project in the last year or so. It could use some love.

@pangeneral
Copy link
Author

pangeneral commented Aug 14, 2019 via email

@micwallace
Copy link
Owner

micwallace commented Aug 14, 2019 via email

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

No branches or pull requests

2 participants