onDestroy

fun onDestroy()

Call this method from the parent Activity/Fragment's corresponding method.

In your Activity/Fragment:

override fun onDestroy() {
super.onDestroy()
mapControl?.onDestroy()
mapControl = null
}

See Also Activity.onDestroy