tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r531678 - /tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
Date Tue, 24 Apr 2007 02:16:56 GMT
Author: markt
Date: Mon Apr 23 19:16:55 2007
New Revision: 531678

URL: http://svn.apache.org/viewvc?view=rev&rev=531678
Log:
Fix possible NPE as a result of previous commit if attributes are set whilst Manager is stopped
- eg config in server.xml or via JMX.

Modified:
    tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java

Modified: tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java?view=diff&rev=531678&r1=531677&r2=531678
==============================================================================
--- tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
(original)
+++ tomcat/container/tc5.5.x/catalina/src/share/org/apache/catalina/session/ManagerBase.java
Mon Apr 23 19:16:55 2007
@@ -62,7 +62,7 @@
  */
 
 public abstract class ManagerBase implements Manager, MBeanRegistration {
-    protected Log log = null;
+    protected Log log = LogFactory.getLog(ManagerBase.class);
 
     // ----------------------------------------------------- Instance Variables
 
@@ -692,13 +692,16 @@
             Registry.getRegistry(null, null).unregisterComponent(oname);
         initialized=false;
         oname = null;
-        log = null;
+        // Don't clear log since it is required in case attributes are changed
+        // (eg via JMX) whilst the manager is stopped.
     }
     
     public void init() {
         if( initialized ) return;
         initialized=true;        
         
+        // Re-initialise the log to prevent memory leaks on reload in case it
+        // was loaded by the webapp classloader
         log = LogFactory.getLog(ManagerBase.class);
         
         if( oname==null ) {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message