diff options
author | drabux <drabux@fouragan.net> | 2017-10-06 01:49:19 +0200 |
---|---|---|
committer | drabux <drabux@fouragan.net> | 2017-10-06 01:52:11 +0200 |
commit | ba689273a6e38ab58512c6caf4f3d1027473003f (patch) | |
tree | 438ea0f4ba628930e28ca394fcc2f59c161f316f /app | |
parent | 77ee4558e718da5e86edf4ff34507e590c9b0e15 (diff) | |
download | AntennaPod-ba689273a6e38ab58512c6caf4f3d1027473003f.zip |
fix wifi service mem leak
The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N.
Try changing activity to activity.getApplicationContext()
[WifiManagerLeak]
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java index 7777af450..2ca7dd029 100644 --- a/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java +++ b/app/src/main/java/de/danoeh/antennapod/preferences/PreferenceController.java @@ -759,7 +759,7 @@ public class PreferenceController implements SharedPreferences.OnSharedPreferenc clearAutodownloadSelectedNetworsPreference(); } // get configured networks - WifiManager wifiservice = (WifiManager) activity.getSystemService(Context.WIFI_SERVICE); + WifiManager wifiservice = (WifiManager) activity.getApplicationContext().getSystemService(Context.WIFI_SERVICE); List<WifiConfiguration> networks = wifiservice.getConfiguredNetworks(); if (networks != null) { |