Skip to content

Commit 53a414e

Browse files
kuhnroyaljosxha
andauthored
Fix #445 stop listening for updates before stopping/destroying the view (#459)
Fixes #445 changing the order of cleanup and view disposal. Co-authored-by: Joscha <[email protected]>
1 parent c842911 commit 53a414e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

maplibre_gl/android/src/main/java/org/maplibre/maplibregl/MapLibreMapController.java

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

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

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

0 commit comments

Comments
 (0)