Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

iOS SDK crashing when adding multiple sources in a loop using -[MGLStyle addSource:] #598

Open
marcinmatczuk opened this issue Mar 26, 2021 · 0 comments

Comments

@marcinmatczuk
Copy link

Steps to reproduce

  1. Add multiple sources in a loop by calling -[MGLStyle addSource:] in -[MGLMapViewDelegate mapView:didFinishLoadingStyle:]

Expected behavior

No crash. All soures added.

Actual behavior

Crash:

libc++abi.dylib: terminating with uncaught exception of type mapbox::util::bad_variant_access
terminating with uncaught exception of type mapbox::util::bad_variant_access

Other

I had a quick look at C++ impl of addSource and it seems to register observes that notify once source is added/loaded (e.g. onSourceLoaded), but this is not exposed to iOS SDK and my question is: is there some synchronisation mechanism in place or when should I add next source, so I'm sure style is ready to receive it?

Configuration

Mapbox SDK versions: 6.3.0
iOS/macOS versions: iOS 14.4
Device/simulator models: iPhone 12 mini, iPhone 11, iPhone 8, and simulators (all devices are affected I believe)
Xcode version: 12.4

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

No branches or pull requests

1 participant