Conversation
8cc4e47 to
2225ac6
Compare
kiryldz
reviewed
Feb 22, 2022
pengdev
reviewed
Feb 22, 2022
...ncomponent/src/main/java/com/mapbox/maps/plugin/locationcomponent/DefaultLocationProvider.kt
Show resolved
Hide resolved
ank27
approved these changes
Feb 22, 2022
kiryldz
reviewed
Feb 22, 2022
| * Fix location puck not being shown if map is created without initial style (e.g. MapInitOptions.styleUri == null) and then loaded asynchronously. ([#1114](https://github.com/mapbox/mapbox-maps-android/pull/1114)) | ||
| * Fix crash within location plugin that happens when style is reloaded simultaneously with location plugin updates. ([#1112](https://github.com/mapbox/mapbox-maps-android/pull/1112)) | ||
| * Fix memory leak in location component. ([#1093](https://github.com/mapbox/mapbox-maps-android/pull/1093)) | ||
| * Fix memory leak in location component. ([#1093](https://github.com/mapbox/mapbox-maps-android/pull/1093), [#1172](https://github.com/mapbox/mapbox-maps-android/pull/1172)) |
Contributor
There was a problem hiding this comment.
as I've said before I'd remove link to #1093 as it does not actually fix the leak if I understood correctly
Contributor
Author
There was a problem hiding this comment.
Actually #1093 resolved it, by adding WeakReference context that lives on CompassEngine is no more kept by GoogleLocationEngine callback.
And 1172 just adds more safety, additionally using applicationContext everywhere in the LocationEngine/CompassEngine, thus making any leaks not possible now and in future.
Basically any of those fixes would be sufficient, and both of them work too =)
kiryldz
approved these changes
Feb 22, 2022
Contributor
kiryldz
left a comment
There was a problem hiding this comment.
LGTM with one nit.
Great work on digging to the very root cause by the way!
27571ba to
bdd3c75
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of changes
Pass application context to the location provider to avoid possible memory leaks due to Binder holding context.
User impact (optional)
Pull request checklist:
@JvmOverloads,@file:JvmName, etc)../gradlew apiDumpto update generated api files, if there's public API changes, otherwise theverify-kotlin-binary-compatibilityCI will fail.mapbox-maps-androidchangelog:<changelog></changelog>.v10.[version]release branch fix / enhancement, merge it tomainfirstly and then port tov10.[version]release branch.Fixes: < Link to related issues that will be fixed by this pull request, if they exist >
PRs must be submitted under the terms of our Contributor License Agreement CLA.