onDestroy

fun onDestroy()

Releases resources held by this data source.

In particular, evaluate may register a pending callback that only fires once the associated MapboxMap's size becomes ready; if that never happens, the callback (and everything it references, including this data source) would otherwise never be released. Call this once this instance is no longer going to be used, typically alongside the owning MapboxMap/MapView being destroyed.