Merge \\\"Fix memory leak in MediaScannerConnection\\\" am: e40ab18590 am: 0d5bcda101

am: fd743b4d56

Change-Id: I9a8ef3f3ae06b5054f426e7936c5aa9548a9dfcd
This commit is contained in:
xiaoli.xb.zuo
2016-07-26 15:55:13 +00:00
committed by android-build-merger

View File

@@ -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;