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

Memory leak? #133

Closed
aparajita opened this issue Oct 19, 2020 · 4 comments · Fixed by #149
Closed

Memory leak? #133

aparajita opened this issue Oct 19, 2020 · 4 comments · Fixed by #149
Labels

Comments

@aparajita
Copy link
Contributor

https://github.com/ionic-team/capacitor/blob/c3e821ef2a4cf20c31b3b0bd6b9ca95c717b0219/android/capacitor/src/main/java/com/getcapacitor/Splash.java#L41-L42

Android Studio is giving me the following warning about these lines:

Do not place Android context classes in static fields; this is a memory leak

@imhoffd
Copy link
Contributor

imhoffd commented Dec 2, 2020

@aparajita I assume you're addressing this in your splash screen plugin? Can this be closed?

@aparajita
Copy link
Contributor Author

aparajita commented Dec 2, 2020

@dwieeb Ultimately I'd like to see if we can move the splash code out of core on Android and completely into the plugin, the way it is on iOS. Can you think of a technical reason why this can't be done?

If all of the code is in the instantiated plugin, those warnings go away because it isn't static any more.

@aparajita
Copy link
Contributor Author

@dwieeb So I moved all of the code in Splash.java into the plugin, and it's working fine. It doesn't appear as soon in the startup, but that can be addressed separately. It's much, much cleaner to have all of the code in the plugin — it can technically be moved into the capacitor-plugins repo now.

@jcesarmobile jcesarmobile transferred this issue from ionic-team/capacitor Dec 10, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 30, 2022

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants