Fixed unclosed cursor
This commit is contained in:
parent
f12860d87e
commit
281b7df3d3
@ -230,11 +230,15 @@ public class BartContentProvider extends ContentProvider {
|
|||||||
+ RoutesColumns.TO_STATION.string + "=?",
|
+ RoutesColumns.TO_STATION.string + "=?",
|
||||||
new String[] { origin, destination }, null, null, null);
|
new String[] { origin, destination }, null, null, null);
|
||||||
|
|
||||||
|
try {
|
||||||
if (query.moveToFirst()) {
|
if (query.moveToFirst()) {
|
||||||
return update(ContentUris.withAppendedId(
|
return update(ContentUris.withAppendedId(
|
||||||
Constants.FAVORITE_CONTENT_URI, query.getLong(0)),
|
Constants.FAVORITE_CONTENT_URI, query.getLong(0)),
|
||||||
values, where, whereArgs);
|
values, where, whereArgs);
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
CursorUtils.closeCursorQuietly(query);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user