* commit 'b9c597a72d2e20a23351a832916cea7353f4fc41': Fix cursor leak in ContactsBinaryDictionary
This commit is contained in:
commit
c6f4d16826
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) {
|
||||||
return cursor.getCount();
|
try {
|
||||||
|
return cursor.getCount();
|
||||||
|
} finally {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue