revert shutdown hook (it's part of .destroyOnExit())

master
Robinson 2023-06-07 23:57:25 +02:00
parent 92e311a63a
commit d4056e8b2e
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
1 changed files with 0 additions and 10 deletions

View File

@ -169,15 +169,6 @@ class DeferredProcessResult internal constructor(private val process: Process,
@Volatile
var processResult: SyncProcessResult? = null
// Make sure that our process is destroyed if the JVM is shutdown while it is still running.
private val shutdownHook: Thread
init {
shutdownHook = Thread({ process.destroyForcibly() })
Runtime.getRuntime().addShutdownHook(shutdownHook)
}
/**
* Starts the process. this is always called.
*/
@ -432,7 +423,6 @@ class DeferredProcessResult internal constructor(private val process: Process,
params.listener.afterFinish(process, result)
result
} finally {
Runtime.getRuntime().removeShutdownHook(shutdownHook)
// Invoke listeners - regardless process finished or got cancelled
params.listener.afterStop(process)
}