Ensure there is only one shutdown hook

The effect of not doing this is not often noticeable, but you sometimes
get a race condition between a context and its parent closing in different
threads without it.
This commit is contained in:
Dave Syer
2015-06-04 08:53:14 +01:00
parent 6d4248bbcd
commit 5d7f18f91f

View File

@@ -141,6 +141,7 @@ public class BootstrapApplicationListener implements
} }
} }
if (!installed) { if (!installed) {
application.setRegisterShutdownHook(false);
application.addInitializers(new AncestorInitializer(context)); application.addInitializers(new AncestorInitializer(context));
} }