Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

ConnectivityManager leak in MainActivity #3525

Closed
tobrun opened this issue Jan 12, 2016 · 7 comments
Closed

ConnectivityManager leak in MainActivity #3525

tobrun opened this issue Jan 12, 2016 · 7 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@tobrun
Copy link
Member

tobrun commented Jan 12, 2016

device-2016-01-12-153541

@tobrun tobrun added the Android Mapbox Maps SDK for Android label Jan 12, 2016
@tobrun tobrun added this to the android-v3.1.0 milestone Jan 12, 2016
@tobrun
Copy link
Member Author

tobrun commented Jan 12, 2016

I believe this is rather an Android SDK issue than a Mapbox one..

@tobrun
Copy link
Member Author

tobrun commented Jan 14, 2016

I have created an issue on issue tracker of LeakCanary as in the AOSP issue tracker

@tobrun
Copy link
Member Author

tobrun commented Jan 14, 2016

There is currently nothing actionable to do for us. closing.

@tobrun tobrun closed this as completed Jan 14, 2016
@tobrun
Copy link
Member Author

tobrun commented Jan 19, 2016

I have identified that this line is the problem:

ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);

This leak can be prevented if we replace above with:

ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext()
                .getSystemService(Context.CONNECTIVITY_SERVICE);

@tobrun
Copy link
Member Author

tobrun commented Jan 19, 2016

This will land in the release branch of 3.1.0 in #3537.

@tobrun
Copy link
Member Author

tobrun commented Jan 19, 2016

This landed with 5ff95d4 in branch mentioned above.

@saiidabs
Copy link

@tobrun thanks man , i was stuck on this problem , life saver

ligi added a commit to ligi/SnackEngage that referenced this issue Oct 23, 2016
ligi added a commit to ligi/SnackEngage that referenced this issue Oct 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

3 participants