mirror of
https://github.com/sbt/sbt.git
synced 2026-09-03 16:39:24 +02:00
Remove the shutdown hook when it's done
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user