Skip to content

Commit

Permalink
fixed closing resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyofrancis committed Dec 22, 2020
1 parent 81c67d7 commit db82901
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -32,7 +32,8 @@ open class DefaultStorageResolver(
return false
}
return try {
getOutputResourceWrapper(file, context.contentResolver)
val outputResourceWrapper = getOutputResourceWrapper(file, context.contentResolver)
outputResourceWrapper.close()
true
} catch (e: Exception) {
false
Expand Down
Expand Up @@ -259,6 +259,7 @@ fun allocateFile(file: File, contentLength: Long) {
try {
val randomAccessFile = RandomAccessFile(file, "rw")
randomAccessFile.setLength(contentLength)
randomAccessFile.close()
} catch (e: Exception) {
throw IOException(FILE_ALLOCATION_ERROR)
}
Expand Down

0 comments on commit db82901

Please sign in to comment.