Skip to content

Commit

Permalink
Small memory leak resolved. Detected on Kitkat when an activity is de…
Browse files Browse the repository at this point in the history
…stroyed, the animator was keeping a reference to it.
  • Loading branch information
danielwilson1702 committed Sep 17, 2016
1 parent 8dbdce4 commit f6da1c4
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,16 @@ private static Interpolator createInterpolator(int type) {
}
}

@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();

if (mAnimatorSet != null) {
mAnimatorSet.cancel();
mAnimatorSet = null;
}
}

private class PulseView extends View {

public PulseView(Context context) {
Expand Down

0 comments on commit f6da1c4

Please sign in to comment.