Skip to content

Commit e4ec107

Browse files
authored
Merge pull request scala-js#3652 from exoego/resource-leak
Fix potential resource leak
2 parents e01cc18 + 559598f commit e4ec107

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

partest/src/main-partest-1.0.16/scala/tools/partest/scalajs/ScalaJSPartest.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ class ScalaJSRunner(testFile: File, suiteRunner: SuiteRunner,
4747
new nest.NestUI(diffOnFail = options.showDiff, colorEnabled = true)) {
4848
private val compliantSems: List[String] = {
4949
scalaJSConfigFile("sem").fold(List.empty[String]) { file =>
50-
Source.fromFile(file).getLines.toList
50+
val source = Source.fromFile(file)
51+
try {
52+
source.getLines.toList
53+
} finally {
54+
source.close()
55+
}
5156
}
5257
}
5358

0 commit comments

Comments
 (0)