Close cursor before returning

This commit is contained in:
ByteHamster 2017-10-15 16:23:30 +02:00
parent d9bdc1357e
commit 28f52d0ea6
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);