Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fc0fc0e3 authored by Dake Gu's avatar Dake Gu
Browse files

ActivityTransitionCoordinator: Fix memory leak of ResultReceiver

The ActivityTransitionCoordinator is retained by reference from native code.
The coordinator refers to a app's listener which can cause leak.

b/16737906

Change-Id: Ibbb85480b852442f95b00a8d3beff0161bdadb47
parent cc5889dc
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -196,7 +196,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
    final protected ArrayList<View> mSharedElements = new ArrayList<View>();
    final protected ArrayList<String> mSharedElementNames = new ArrayList<String>();
    final protected ArrayList<View> mTransitioningViews = new ArrayList<View>();
    final protected SharedElementListener mListener;
    protected SharedElementListener mListener;
    protected ResultReceiver mResultReceiver;
    final private FixedEpicenterCallback mEpicenterCallback = new FixedEpicenterCallback();
    final protected boolean mIsReturning;
@@ -564,6 +564,7 @@ abstract class ActivityTransitionCoordinator extends ResultReceiver {
        mTransitioningViews.clear();
        mResultReceiver = null;
        mPendingTransition = null;
        mListener = null;
    }

    protected long getFadeDuration() {