From 4946b95bff4475735d5cf9eec555ae3767a08540 Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Wed, 5 Jul 2023 14:10:00 +0200 Subject: [PATCH] Make sure no callbacks are called when GoogleMap is destroyed We faced an IllegalStateException related to a null root view of a fragment layout. If the GoogleMap is destroyed, there is no need to call the callbacks related to it in an upcoming future. --- .../src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt index ab3e81112..d473e7c33 100644 --- a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt +++ b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/GoogleMap.kt @@ -800,6 +800,7 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG override fun onPause() = mapView?.onPause() ?: Unit override fun onDestroy() { Log.d(TAG, "destroy"); + userOnInitializedCallbackList.clear() lineManager?.onDestroy() lineManager = null -- GitLab