-
Notifications
You must be signed in to change notification settings - Fork 131
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
Don't call initialize twice when getStyle callback fires several times. #1112
Conversation
@@ -49,20 +49,22 @@ internal class LocationPuckManager( | |||
} | |||
|
|||
fun initialize(style: StyleInterface) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initialize method called from updateSettings waits for the style at getStyle.
If updateSettings was called multiple times multiple callbacks will fire after style arrives causing crash.
...ponent/src/main/java/com/mapbox/maps/plugin/locationcomponent/LocationComponentPluginImpl.kt
Show resolved
Hide resolved
...ationcomponent/src/main/java/com/mapbox/maps/plugin/locationcomponent/LocationPuckManager.kt
Show resolved
Hide resolved
...nt/src/test/java/com/mapbox/maps/plugin/locationcomponent/LocationComponentPluginImplTest.kt
Show resolved
Hide resolved
Missing update changelog and guess it would be nice to add a bit more details about the issue we're fixing here as current entry is very high-level |
9486246
to
ce4b6f4
Compare
Co-authored-by: Kiryl Dzehtsiarenka <kiryl.dzehtsiarenka@mapbox.com>
This PR fixes possible crash with Location persistent layer being added twice.
This had happened for 1tap, for example.
Summary of changes
User impact (optional)
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).mapbox-maps-android
changelog:<changelog>Fix crash within location plugin that happens when style is reloaded simultaneously with location plugin updates.</changelog>
.v10.[version]
release branch fix / enhancement, merge it tomain
firstly 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.