diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-05-19 13:19:50 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-05-19 13:19:50 +0000 |
commit | dbe346af1c5de3251c8cd18e4476916f0e7daebe (patch) | |
tree | 4a8045928dc94c84a715ae989bf9d51de6692a20 /src | |
parent | 47d6dff4ebc6c91fbe4eb375c2edfec7aeea1863 (diff) | |
download | scala-dbe346af1c5de3251c8cd18e4476916f0e7daebe.tar.gz scala-dbe346af1c5de3251c8cd18e4476916f0e7daebe.tar.bz2 scala-dbe346af1c5de3251c8cd18e4476916f0e7daebe.zip |
close the interpreter in before exiting, so tha...
close the interpreter in before exiting, so that it can clean up any
class files it created
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 + } } } |