Fix registration of shutdown handler as a shutdown hook
Closes gh-4311
This commit is contained in:
committed by
Andy Wilkinson
parent
04fa7e4d27
commit
180815445c
@@ -337,7 +337,7 @@ public class LoggingApplicationListener implements GenericApplicationListener {
|
||||
Runnable shutdownHandler = loggingSystem.getShutdownHandler();
|
||||
if (shutdownHandler != null
|
||||
&& shutdownHookRegistered.compareAndSet(false, true)) {
|
||||
Runtime.getRuntime().addShutdownHook(new Thread());
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(shutdownHandler));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user