Fix registration of shutdown handler as a shutdown hook

Closes gh-4311
This commit is contained in:
Johnny Lim
2015-10-27 13:47:59 +09:00
committed by Andy Wilkinson
parent 04fa7e4d27
commit 180815445c

View File

@@ -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));
}
}
}