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

Make errors during remove source a warning rather than a hard error #1119

Merged
merged 1 commit into from
Nov 30, 2020

Conversation

mfazekas
Copy link
Contributor

Fixes/silences the following error:

java.lang.Error: Cannot remove detached source
    at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRemoveSource(NativeMapView.java)
    at com.mapbox.mapboxsdk.maps.NativeMapView.removeSource(NativeMapView.java:925)
    at com.mapbox.mapboxsdk.maps.Style.removeSource(Style.java:175)
    at com.mapbox.rctmgl.components.styles.sources.RCTSource.removeFromMap(RCTSource.java:158)
    at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.removeAllSourcesFromMap(RCTMGLMapView.java:1229)
    at com.mapbox.rctmgl.components.mapview.RCTMGLMapView.setReactStyleURL(RCTMGLMapView.java:755)
    at com.mapbox.rctmgl.components.mapview.RCTMGLMapViewManager.setStyleURL(RCTMGLMapViewManager.java:120)
    at java.lang.reflect.Method.invoke(Method.java)

I could not reproduce the root cause, either a race, or because the sources were removed twice, somehow.
In any case the errors during source remove is now a warning only.

Copy link
Member

@ferdicus ferdicus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏿

@mfazekas mfazekas merged commit ed19d2a into master Nov 30, 2020
@ferdicus ferdicus deleted the mfazekas/fix-throw-remove branch August 20, 2021 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants