diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt index 3904fb3b6..3b2302f80 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt @@ -177,6 +177,10 @@ private fun MapLifecycle(mapView: MapView) { onDispose { lifecycle.removeObserver(mapLifecycleObserver) context.unregisterComponentCallbacks(callbacks) + } + } + DisposableEffect(mapView) { + onDispose { mapView.onDestroy() mapView.removeAllViews() }