Fix cursor leak in ContactsBinaryDictionary
Bug: 6529131 Change-Id: I86493705fbf069ba7a6c43581cfbd1bcc27ff1bamain
parent
16950d65c3
commit
2798c85c0f
|
@ -149,7 +149,11 @@ public class ContactsBinaryDictionary extends ExpandableBinaryDictionary {
|
|||
final Cursor cursor = mContext.getContentResolver().query(
|
||||
Contacts.CONTENT_URI, PROJECTION_ID_ONLY, null, null, null);
|
||||
if (cursor != null) {
|
||||
return cursor.getCount();
|
||||
try {
|
||||
return cursor.getCount();
|
||||
} finally {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue