Skip to content

Commit

Permalink
Merge pull request #1374 from alexarchambault/nit
Browse files Browse the repository at this point in the history
Nit
  • Loading branch information
alexarchambault authored Jun 4, 2024
2 parents 455474e + e5f7a7a commit 5815433
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,7 @@ class KernelLauncher(
else
Map.empty[String, String]

assert(proc == null)
proc = os.proc(command).spawn(
cwd = dir,
env = extraEnv ++ specExtraEnv,
Expand Down Expand Up @@ -573,7 +574,8 @@ class KernelLauncher(
res
}
finally {
runner0.close()
if (runner0 != null)
runner0.close()
output.close(success = success, printOutputOnError = printOutputOnError)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ object Launcher extends CaseApp[LauncherOptions] {
setDaemon(true)
override def run(): Unit =
if (p.isAlive()) {
System.err.println("Shutting down underlying kernel")
p.close()
val timeout = 500.millis
if (!p.waitFor(timeout.toMillis)) {
Expand All @@ -213,6 +214,7 @@ object Launcher extends CaseApp[LauncherOptions] {
)
p.destroyForcibly()
}
System.err.println("Shut down underlying kernel")
}
}
Runtime.getRuntime.addShutdownHook(hook)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ object Tests {
scalaCliLauncher.toString,
"--power",
"compile",
"--server=false",
"--print-class-path",
"."
)
Expand Down

0 comments on commit 5815433

Please sign in to comment.