Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] - clear map change listeners when map is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobrun committed Apr 24, 2018
1 parent 62b80c3 commit a8d2230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ public void onStop() {
@UiThread
public void onDestroy() {
destroyed = true;
onMapChangedListeners.clear();
mapCallback.clearOnMapReadyCallbacks();

if (nativeMapView != null && hasSurface) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ private boolean isDestroyedOn(String callingMethod) {
}

public void destroy() {
nativeDestroy();
viewCallback = null;
destroyed = true;
onMapChangedListeners.clear();
viewCallback = null;
nativeDestroy();
}

public void update() {
Expand Down

0 comments on commit a8d2230

Please sign in to comment.