mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-04 18:29:23 +02:00
FIXED: Some database cursors weren't closed if the query doesn't return data.
This commit is contained in:
parent
071ecf88d5
commit
ad6d60ad25
1 changed files with 2 additions and 0 deletions
|
@ -344,6 +344,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
protected List<Author> loadAuthors(long bookId) {
|
||||
final Cursor cursor = myDatabase.rawQuery("SELECT Authors.name,Authors.sort_key FROM BookAuthor INNER JOIN Authors ON Authors.author_id = BookAuthor.author_id WHERE BookAuthor.book_id = ?", new String[] { "" + bookId });
|
||||
if (!cursor.moveToNext()) {
|
||||
cursor.close();
|
||||
return null;
|
||||
}
|
||||
final ArrayList<Author> list = new ArrayList<Author>();
|
||||
|
@ -435,6 +436,7 @@ public final class SQLiteBooksDatabase extends BooksDatabase {
|
|||
protected List<Tag> loadTags(long bookId) {
|
||||
final Cursor cursor = myDatabase.rawQuery("SELECT Tags.tag_id FROM BookTag INNER JOIN Tags ON Tags.tag_id = BookTag.tag_id WHERE BookTag.book_id = ?", new String[] { "" + bookId });
|
||||
if (!cursor.moveToNext()) {
|
||||
cursor.close();
|
||||
return null;
|
||||
}
|
||||
ArrayList<Tag> list = new ArrayList<Tag>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue