Fixed unclosed cursor

This commit is contained in:
Doug Keen 2012-09-25 16:29:28 -07:00
parent f12860d87e
commit 281b7df3d3

View File

@ -230,11 +230,15 @@ public class BartContentProvider extends ContentProvider {
+ RoutesColumns.TO_STATION.string + "=?",
new String[] { origin, destination }, null, null, null);
try {
if (query.moveToFirst()) {
return update(ContentUris.withAppendedId(
Constants.FAVORITE_CONTENT_URI, query.getLong(0)),
values, where, whereArgs);
}
} finally {
CursorUtils.closeCursorQuietly(query);
}
}
return 0;
}