[android] - avoid leaking compassView context through animator
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user