Fix cursor leak in ContactsBinaryDictionary
Bug: 6529131 Change-Id: I86493705fbf069ba7a6c43581cfbd1bcc27ff1ba
This commit is contained in:
parent
16950d65c3
commit
2798c85c0f
1 changed files with 5 additions and 1 deletions
|
@ -149,7 +149,11 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
|
||||||
final Cursor cursor = mContext.getContentResolver().query(
|
final Cursor cursor = mContext.getContentResolver().query(
|
||||||
Contacts.CONTENT_URI, PROJECTION_ID_ONLY, null, null, null);
|
Contacts.CONTENT_URI, PROJECTION_ID_ONLY, null, null, null);
|
||||||
if (cursor != null) {
|
if (cursor != null) {
|
||||||
|
try {
|
||||||
return cursor.getCount();
|
return cursor.getCount();
|
||||||
|
} finally {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue