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

Commit 6e02888c authored by xiaoli.xb.zuo's avatar xiaoli.xb.zuo Committed by android-build-merger
Browse files

Fix memory leak in MediaScannerConnection

am: 439e5e49

Change-Id: I0ec325ca19d892d9280563fcd6a7343fafcf18c4
parents 89ff02cd 439e5e49
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -133,6 +133,10 @@ public class MediaScannerConnection implements ServiceConnection {
                }
                try {
                    mContext.unbindService(this);
                    if (mClient instanceof ClientProxy) {
                        mClient = null;
                    }
                    mService = null;
                } catch (IllegalArgumentException ex) {
                    if (false) {
                        Log.v(TAG, "disconnect failed: " + ex);
@@ -205,6 +209,7 @@ public class MediaScannerConnection implements ServiceConnection {
        void scanNextPath() {
            if (mNextPath >= mPaths.length) {
                mConnection.disconnect();
                mConnection = null;
                return;
            }
            String mimeType = mMimeTypes != null ? mMimeTypes[mNextPath] : null;