From: markt Date: Sun, 2 May 2010 14:25:42 +0000 (+0000) Subject: Clean-up post init/destroy lifecycle refactoring X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=05d783077572ca4c75a8881a5f4bfeaa5babd5ee;p=tomcat7.0 Clean-up post init/destroy lifecycle refactoring By default, remove children on destroy, not stop git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@940236 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index 476e8b977..d6dff03e9 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -1022,11 +1022,6 @@ public abstract class ContainerBase extends LifecycleBase for (int i = 0; i < children.length; i++) { children[i].stop(); } - // Remove children - so next start can work - children = findChildren(); - for (int i = 0; i < children.length; i++) { - removeChild(children[i]); - } // Stop our subordinate components, if any if ((resources != null) && (resources instanceof Lifecycle)) { @@ -1094,6 +1089,11 @@ public abstract class ContainerBase extends LifecycleBase @Override protected void destroyInternal() throws LifecycleException { + // Remove children now this container is being destroyed + for (Container child : findChildren()) { + child.destroy(); + } + // unregister this component if ( oname != null ) { try {