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

Fix possible memory leak for Android and update gradle #8723

Merged
merged 2 commits into from
May 12, 2017

Conversation

volzhs
Copy link
Contributor

@volzhs volzhs commented May 12, 2017

there is an error message when compile with latest build tool for android.

/godot_dev/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java:575: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]
            mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "WifiManagerLeak":
   On versions prior to Android N (24), initializing the WifiManager via
   Context#getSystemService can cause a memory leak if the context is not the
   application context. Change context.getSystemService(...) to
   context.getApplicationContext().getSystemService(...).

1 errors, 0 warnings

this pr will fix the error and update to latest gradle.

volzhs added 2 commits May 12, 2017 14:44
/godot_dev/platform/android/java/src/com/google/android/vending/expansion/downloader/impl/DownloaderService.java:575: Error: The WIFI_SERVICE must be looked up on the Application context or memory will leak on devices < Android N. Try changing  to .getApplicationContext()  [WifiManagerLeak]
            mWifiManager = (WifiManager) getSystemService(Context.WIFI_SERVICE);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "WifiManagerLeak":
   On versions prior to Android N (24), initializing the WifiManager via
   Context#getSystemService can cause a memory leak if the context is not the
   application context. Change context.getSystemService(...) to
   context.getApplicationContext().getSystemService(...).

1 errors, 0 warnings
@volzhs volzhs added this to the 3.0 milestone May 12, 2017
@akien-mga akien-mga merged commit 413e68f into godotengine:master May 12, 2017
@volzhs volzhs deleted the fix-android-master branch May 12, 2017 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants