Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix memory leak on android #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Maikell84
Copy link

Gradle linter gives a warning:

:lintVitalRelease/home/michael/Projects/smart-mirror/application/platforms/android/src/com/pylonproducts/wifiwizard/WifiWizard.java:57: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing cordova.getActivity() to cordova.getActivity().getApplicationContext() [WifiManagerLeak]
this.wifiManager = (WifiManager) cordova.getActivity().getSystemService(Context.WIFI_SERVICE);

This PR resolves it.

@tripflex
Copy link

tripflex commented Jan 5, 2018

Thanks for this, I created a fork of WifiWizard (named WifiWizard2), and added this PR to it, along with credit for you in the changelog:
https://github.com/tripflex/WifiWizard2

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants