[android] - avoid leaking compassView context through animator

This commit is contained in:
tobrun
2019-01-16 16:22:01 +01:00
committed by Tobrun
parent 69eb856f9a
commit 6e856ebb67
2 changed files with 6 additions and 1 deletions

View File

@@ -411,6 +411,11 @@ public class MapView extends FrameLayout implements NativeMapView.ViewCallback {
mapCallback.onDestroy();
initialRenderCallback.onDestroy();
if (compassView != null) {
// avoid leaking context through animator #13742
compassView.resetAnimation();
}
if (mapboxMap != null) {
mapboxMap.onDestroy();
}

View File

@@ -68,7 +68,7 @@ public final class CompassView extends AppCompatImageView implements Runnable {
this.isAnimating = isAnimating;
}
private void resetAnimation() {
public void resetAnimation() {
if (fadeAnimator != null) {
fadeAnimator.cancel();
}