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 MapboxMap extension plugin functions throwing exceptions #1591
Merged
kiryldz
merged 4 commits into
main
from
MAPSAND-317-possible-crash-when-accessing-gestures-camera-from-extension-functions
Aug 15, 2022
Merged
Fix MapboxMap extension plugin functions throwing exceptions #1591
kiryldz
merged 4 commits into
main
from
MAPSAND-317-possible-crash-when-accessing-gestures-camera-from-extension-functions
Aug 15, 2022
Conversation
This file contains 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
kiryldz
force-pushed
the
MAPSAND-317-possible-crash-when-accessing-gestures-camera-from-extension-functions
branch
from
August 12, 2022 11:56
1e1ae16
to
aa7c07c
Compare
alexander-kulikovskii
approved these changes
Aug 12, 2022
alexander-kulikovskii
approved these changes
Aug 12, 2022
Chaoba
approved these changes
Aug 15, 2022
yunikkk
reviewed
Aug 15, 2022
plugin-animation/src/main/java/com/mapbox/maps/plugin/animation/CameraAnimationsExt.kt
Outdated
Show resolved
Hide resolved
yunikkk
reviewed
Aug 15, 2022
kiryldz
force-pushed
the
MAPSAND-317-possible-crash-when-accessing-gestures-camera-from-extension-functions
branch
from
August 15, 2022 09:18
71c3663
to
d7bf2f9
Compare
9 tasks
kiryldz
deleted the
MAPSAND-317-possible-crash-when-accessing-gestures-camera-from-extension-functions
branch
August 15, 2022 10:20
9 tasks
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
When using extension functions for camera and gesture plugins (e.g.
MapboxMap.flyTo
and others) we previously were relying on weak references. That could lead to runtime crash:checkNotNull(cameraAnimationsPlugin?.get()) { "Camera plugin is not added as the part of MapInitOptions for given MapView." }
not only when camera plugin was excluded (as was per design) but also let's say when
MapView
was already destroyed and extension function was accessed.Fixed this by removing weak references and improving warning messages.
User impact (optional)
Pull request checklist:
@JvmOverloads
,@file:JvmName
, etc).make update-api
to update generated api files, if there's public API changes, otherwise theverify-api-*
CI steps might fail.check changelog
CI step will fail.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.