Merge "Fix memory leak in MediaScannerConnection"
This commit is contained in:
@@ -133,6 +133,10 @@ public class MediaScannerConnection implements ServiceConnection {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
mContext.unbindService(this);
|
mContext.unbindService(this);
|
||||||
|
if (mClient instanceof ClientProxy) {
|
||||||
|
mClient = null;
|
||||||
|
}
|
||||||
|
mService = null;
|
||||||
} catch (IllegalArgumentException ex) {
|
} catch (IllegalArgumentException ex) {
|
||||||
if (false) {
|
if (false) {
|
||||||
Log.v(TAG, "disconnect failed: " + ex);
|
Log.v(TAG, "disconnect failed: " + ex);
|
||||||
@@ -205,6 +209,7 @@ public class MediaScannerConnection implements ServiceConnection {
|
|||||||
void scanNextPath() {
|
void scanNextPath() {
|
||||||
if (mNextPath >= mPaths.length) {
|
if (mNextPath >= mPaths.length) {
|
||||||
mConnection.disconnect();
|
mConnection.disconnect();
|
||||||
|
mConnection = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String mimeType = mMimeTypes != null ? mMimeTypes[mNextPath] : null;
|
String mimeType = mMimeTypes != null ? mMimeTypes[mNextPath] : null;
|
||||||
|
|||||||
Reference in New Issue
Block a user