mirror of https://github.com/sbt/sbt.git
Merge pull request #4204 from eed3si9n/wip/fix-shutdownhook
Remove the shutdown hook when it's done
This commit is contained in:
commit
21db286766
|
|
@ -115,10 +115,20 @@ object StandardMain {
|
|||
val previous = TrapExit.installManager()
|
||||
try {
|
||||
try {
|
||||
try {
|
||||
val hooked = try {
|
||||
Runtime.getRuntime.addShutdownHook(shutdownHook)
|
||||
true
|
||||
} catch {
|
||||
case _: IllegalArgumentException => false
|
||||
}
|
||||
try {
|
||||
MainLoop.runLogged(s)
|
||||
} finally exchange.shutdown
|
||||
} finally {
|
||||
exchange.shutdown
|
||||
if (hooked) {
|
||||
Runtime.getRuntime.removeShutdownHook(shutdownHook)
|
||||
}
|
||||
}
|
||||
} finally DefaultBackgroundJobService.backgroundJobService.shutdown()
|
||||
} finally TrapExit.uninstallManager(previous)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue