Skip to content

Commit edab35a

Browse files
committed
Fix maplibre#445 stop listening for updates before stopping/destroying the view (maplibre#459)
Fixes maplibre#445 changing the order of cleanup and view disposal.
1 parent 53c3efa commit edab35a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

android/src/main/java/com/mapbox/mapboxgl/MapboxMapController.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1771,15 +1771,17 @@ private void destroyMapViewIfNecessary() {
17711771
if (mapView == null) {
17721772
return;
17731773
}
1774-
mapViewContainer.removeView(mapView);
1775-
mapView.onStop();
1776-
mapView.onDestroy();
17771774

17781775
if (locationComponent != null) {
17791776
locationComponent.setLocationComponentEnabled(false);
17801777
}
17811778
stopListeningForLocationUpdates();
17821779

1780+
mapViewContainer.removeView(mapView);
1781+
1782+
mapView.onStop();
1783+
mapView.onDestroy();
1784+
17831785
mapView = null;
17841786
}
17851787

0 commit comments

Comments
 (0)