am b9c597a7: am 2798c85c: Fix cursor leak in ContactsBinaryDictionary

* commit 'b9c597a72d2e20a23351a832916cea7353f4fc41':
  Fix cursor leak in ContactsBinaryDictionary
main
Tom Ouyang 2012-05-21 17:15:28 -07:00 committed by Android Git Automerger
commit c6f4d16826
1 changed files with 5 additions and 1 deletions

View File

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