Skip to content

Commit

Permalink
Close the stream
Browse files Browse the repository at this point in the history
Co-authored-by: Gaëtan Muller <[email protected]>
  • Loading branch information
StaehliJ and MGaetan89 authored Dec 21, 2023
1 parent 3a9632f commit 80cff6e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ class PillarboxMediaDescriptionAdapter(
}
runBlocking(Dispatchers.IO) {
val result = runCatching {
BitmapFactory.decodeStream(imageUrl.openStream(), null, opts)
imageUrl.openStream().use {
BitmapFactory.decodeStream(it, null, opts)
}
}
result.getOrNull()?.let {
bitmapCache.put(imageUri, it)
Expand Down

0 comments on commit 80cff6e

Please sign in to comment.