@@ -84,16 +84,16 @@ class AMapView(private val context: Context, private val channel: MethodChannel)
frameLayout?.removeView(mapView)
frameLayout = null
}
+ if (aMap != null) {
+ aMap?.setOnMyLocationChangeListener(null)
+ aMap = null
+ }
if (mapView != null) {
+ mapView?.onDestroy()
mapView?.removeAllViews()
infoWindow = null
mapView = null
- aMap?.setOnMyLocationChangeListener(null)
- if (aMap != null) {
- aMap = null
- }
- mapView?.onDestroy()
override fun onMyLocationChange(p0: Location) {