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