am 2798c85c: Fix cursor leak in ContactsBinaryDictionary

* commit '2798c85c0f77fdf4f12eccfe241f84ddec3de994':
  Fix cursor leak in ContactsBinaryDictionary
This commit is contained in:
Tom Ouyang 2012-05-21 17:13:53 -07:00 committed by Android Git Automerger
commit b9c597a72d

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