Skip to content

Commit

Permalink
Fix corrected
Browse files Browse the repository at this point in the history
  • Loading branch information
iromeo committed Jun 26, 2018
1 parent 0010b55 commit 9e3799a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/main/kotlin/org/jetbrains/bio/big/BigBed.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jetbrains.bio.big

import com.google.common.collect.ComparisonChain
import com.google.common.io.Closeables
import org.jetbrains.bio.*
import java.io.IOException
import java.nio.ByteOrder
Expand Down Expand Up @@ -104,8 +105,9 @@ class BigBedFile private constructor(
factory.order = byteOrder

return BigBedFile(src, factory, MAGIC, prefetch, cancelledChecker)
} finally {
factory.close()
} catch (e: Exception) {
Closeables.close(factory, true)
throw e
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/main/kotlin/org/jetbrains/bio/big/BigWig.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jetbrains.bio.big

import com.google.common.io.Closeables
import org.jetbrains.bio.*
import java.io.IOException
import java.nio.ByteOrder
Expand Down Expand Up @@ -180,8 +181,9 @@ class BigWigFile private constructor(
factory.order = byteOrder

return BigWigFile(src, factory, MAGIC, prefetch, cancelledChecker)
} finally {
factory.close()
} catch (e: Exception) {
Closeables.close(factory, true)
throw e
}
}

Expand Down

0 comments on commit 9e3799a

Please sign in to comment.