roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject svn commit: r1708079 - /roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
Date Mon, 12 Oct 2015 10:22:13 GMT
Author: kohei
Date: Mon Oct 12 10:22:13 2015
New Revision: 1708079

URL: http://svn.apache.org/viewvc?rev=1708079&view=rev
Log:
Release weblogger instance which has been used during initialization (it brings ThreadLocal
leak)

Modified:
    roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java

Modified: roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
URL: http://svn.apache.org/viewvc/roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java?rev=1708079&r1=1708078&r2=1708079&view=diff
==============================================================================
--- roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
(original)
+++ roller/trunk/app/src/main/java/org/apache/roller/weblogger/ui/core/RollerContext.java
Mon Oct 12 10:22:13 2015
@@ -24,6 +24,8 @@ import java.util.Properties;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletContextEvent;
 import javax.servlet.ServletContextListener;
+
+import org.apache.roller.weblogger.business.Weblogger;
 import org.springframework.security.authentication.AuthenticationProvider;
 import org.springframework.security.authentication.ProviderManager;
 import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
@@ -153,17 +155,24 @@ public class RollerContext extends Conte
             buf.append("\n--------------------------------------------------------------");
             log.info(buf.toString());
         } else {
+            Weblogger weblogger = null;
+
             try {
                 // trigger bootstrapping process
                 WebloggerFactory.bootstrap();
                 
                 // trigger initialization process
-                WebloggerFactory.getWeblogger().initialize();
+                weblogger = WebloggerFactory.getWeblogger();
+                weblogger.initialize();
                 
             } catch (BootstrapException ex) {
                 log.fatal("Roller Weblogger bootstrap failed", ex);
             } catch (WebloggerException ex) {
                 log.fatal("Roller Weblogger initialization failed", ex);
+            } finally {
+                if (weblogger != null) {
+                    weblogger.release();
+                }
             }
 		}
             



Mime
View raw message