Merge pull request #2442 from ByteHamster/close-cursor

Close cursor before returning
This commit is contained in:
Martin Fietz 2017-10-15 20:00:04 +02:00 committed by GitHub
commit 0ac3706d4f
1 changed files with 1 additions and 0 deletions

View File

@ -905,6 +905,7 @@ public final class DBReader {
Cursor cursor = adapter.getImageCursor(ids); Cursor cursor = adapter.getImageCursor(ids);
int imageCount = cursor.getCount(); int imageCount = cursor.getCount();
if (imageCount == 0) { if (imageCount == 0) {
cursor.close();
return Collections.emptyMap(); return Collections.emptyMap();
} }
Map<Long, FeedImage> result = new ArrayMap<>(imageCount); Map<Long, FeedImage> result = new ArrayMap<>(imageCount);