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

IntentReceiver leak on device rotation #16

Open
GoogleCodeExporter opened this issue Dec 16, 2015 · 2 comments
Open

IntentReceiver leak on device rotation #16

GoogleCodeExporter opened this issue Dec 16, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. start the app
2. rotate the between landscape and portrait
3. check logcat

Expected:
- no logcat messages about leaks

Actual:

- leak indicated in logcat:
E/ActivityThread( 8110): Activity 
com.radioactiveyak.location_best_practices.UI.PlaceActivity has leaked 
IntentReceiver 
com.radioactiveyak.location_best_practices.utils.GingerbreadLastLocationFinder$1
@419b1f00 that was originally registered here. Are you missing a call to 
unregisterReceiver()?

App built from source 2012-0 with Android 3.2 API, running on 4.0.4 (Samsung 
Galaxy Note).

Original issue reported on code.google.com by [email protected] on 3 Aug 2012 at 6:51

@GoogleCodeExporter
Copy link
Author

*built from source 2012-08-03 (r5)

Original comment by [email protected] on 3 Aug 2012 at 6:52

@GoogleCodeExporter
Copy link
Author

It is because "LastLocationFinder" uses Activity's context and 
"singleUpdateReceiver" may outlive the activity, you can use "this.context = 
context.getApplicationContext();" in the constructor, but still 
"locationListener" holds the reference to the old activity, requesting single 
update in LastLocationFinder is broken, you may instead try to send broadcast 
to passive receiver 

Original comment by [email protected] on 18 Feb 2014 at 12:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant