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

Unverified Commit 04cdc161 authored by Likai Ding's avatar Likai Ding Committed by Michael Bestas
Browse files

Gallery: fix a memory leak

If video playing is completed, not paused or cancelled, the Runnables
posted are not removed from the Handler. Make sure they are removed.

Change-Id: I4c27583e4305398b35188c494b6da15f809439b9
CRs-Fixed: 999702
parent ef5bb207
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -691,12 +691,14 @@ public class MoviePlayer implements
        }
        if (mMovieItem.getError()) {
            Log.w(TAG, "error occured, exit the video player!");
            mHandler.removeCallbacksAndMessages(null);
            mActivityContext.finish();
            return;
        }
        if (mPlayerExt.getLoop()) {
            onReplay();
        } else { //original logic
            mHandler.removeCallbacksAndMessages(null);
            mTState = TState.COMPELTED;
            if (mCanReplay) {
                mController.showEnded();