diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/MainScript.scala | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/MainScript.scala b/src/compiler/scala/tools/nsc/MainScript.scala index f95059c3e5..aeec798d61 100644 --- a/src/compiler/scala/tools/nsc/MainScript.scala +++ b/src/compiler/scala/tools/nsc/MainScript.scala @@ -155,12 +155,16 @@ object MainScript { val interpreter = new Interpreter(command.settings) - interpreter.beQuiet - - if(!interpreter.compileSources(List(wrappedScript(scriptFile)))) - return () // compilation error - interpreter.bind("argv", "Array[String]", scriptArgs) - interpreter.interpret("scala.scripting.Main.main(argv)") + try { + interpreter.beQuiet + + if(!interpreter.compileSources(List(wrappedScript(scriptFile)))) + return () // compilation error + interpreter.bind("argv", "Array[String]", scriptArgs) + interpreter.interpret("scala.scripting.Main.main(argv)") + } finally { + interpreter.close + } } } |