TileCache: close db cursor when result is empty

This commit is contained in:
Hannes Janetzek
2014-08-24 09:37:37 +02:00
parent f7a98017b1
commit 2e5ff2e4a4

View File

@@ -263,13 +263,13 @@ public class TileCache implements ITileCache {
if (!cursor.moveToFirst()) {
if (dbg)
log.debug("not in cache {}", tile);
cursor.close();
return null;
}
InputStream in = new ByteArrayInputStream(cursor.getBlob(0));
if (!cursor.isClosed())
cursor.close();
cursor.close();
if (dbg)
log.debug("load tile {}", tile);