Ensure parent context of bootstrap context is closed.
fixes gh-267
This commit is contained in:
@@ -105,7 +105,20 @@ public class ContextRefresher {
|
||||
}
|
||||
finally {
|
||||
ConfigurableApplicationContext closeable = capture;
|
||||
closeable.close();
|
||||
while (closeable != null) {
|
||||
try {
|
||||
closeable.close();
|
||||
}
|
||||
catch (Exception e) {
|
||||
// Ignore;
|
||||
}
|
||||
if (closeable.getParent() instanceof ConfigurableApplicationContext) {
|
||||
closeable = (ConfigurableApplicationContext) closeable.getParent();
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user