-
Notifications
You must be signed in to change notification settings - Fork 40.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register application shutdown hook lazily
Previously, SpringApplicationShutdownHook would always register a shutdown hook, even if SpringApplication was configured not to use a shutdown hook, such as in a war deployment. This could result in a memory leak when the war was undeployed. The shutdown hook registered by SpringApplicationShutdownHook would remain registered, pinning the web application's class loader in memory. This commit updates SpringApplicationShutdownHook so that it registers a shutdown hook with the JVM lazily, upon registeration of the first application context. Fixes gh-27987
- Loading branch information
1 parent
afb81f1
commit a4f1d32
Showing
2 changed files
with
23 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters