* commit '1ae6e4d9dab4e98e2903ca140651fe43fbbb3358': Make sure to close a cursor
This commit is contained in:
commit
a1401e1c87
@ -225,11 +225,17 @@ public final class Account extends EmailContent implements Parcelable {
|
|||||||
new String[] {AccountColumns._ID},
|
new String[] {AccountColumns._ID},
|
||||||
AccountColumns.EMAIL_ADDRESS + "=?", new String[] {emailAddress},
|
AccountColumns.EMAIL_ADDRESS + "=?", new String[] {emailAddress},
|
||||||
null);
|
null);
|
||||||
|
try {
|
||||||
if (c == null || !c.moveToFirst()) {
|
if (c == null || !c.moveToFirst()) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
final long id = c.getLong(c.getColumnIndex(AccountColumns._ID));
|
final long id = c.getLong(c.getColumnIndex(AccountColumns._ID));
|
||||||
return restoreAccountWithId(context, id, observer);
|
return restoreAccountWithId(context, id, observer);
|
||||||
|
} finally {
|
||||||
|
if (c != null) {
|
||||||
|
c.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user