click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bck...@apache.org
Subject svn commit: r958994 - in /click/trunk/click: documentation/docs/roadmap-changes.html framework/src/org/apache/click/Context.java
Date Tue, 29 Jun 2010 14:33:48 GMT
Author: bckfnn
Date: Tue Jun 29 14:33:47 2010
New Revision: 958994

URL: http://svn.apache.org/viewvc?rev=958994&view=rev
Log:
avoid creating a context stack in hasThreadLocalContext(). CLK-706

Modified:
    click/trunk/click/documentation/docs/roadmap-changes.html
    click/trunk/click/framework/src/org/apache/click/Context.java

Modified: click/trunk/click/documentation/docs/roadmap-changes.html
URL: http://svn.apache.org/viewvc/click/trunk/click/documentation/docs/roadmap-changes.html?rev=958994&r1=958993&r2=958994&view=diff
==============================================================================
--- click/trunk/click/documentation/docs/roadmap-changes.html (original)
+++ click/trunk/click/documentation/docs/roadmap-changes.html Tue Jun 29 14:33:47 2010
@@ -93,6 +93,10 @@ includes improved Ajax support and @Bind
       </div>
       <ul style="padding: 0em; margin-left:0em;margin-bottom: 2em">
          <li class="change">
+            Avoid a potential memory leak when undeploying a click application.
+            [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-706">CLK-706</a>].
+         </li>
+         <li class="change">
             Load <a href="extras-api/org/apache/click/extras/control/DateField.html">DateField</a>
             translations for month and day names from the JDK.
             [<a target="_blank" href="https://issues.apache.org/jira/browse/CLK-650">CLK-650</a>].

Modified: click/trunk/click/framework/src/org/apache/click/Context.java
URL: http://svn.apache.org/viewvc/click/trunk/click/framework/src/org/apache/click/Context.java?rev=958994&r1=958993&r2=958994&view=diff
==============================================================================
--- click/trunk/click/framework/src/org/apache/click/Context.java (original)
+++ click/trunk/click/framework/src/org/apache/click/Context.java Tue Jun 29 14:33:47 2010
@@ -199,7 +199,11 @@ public class Context {
      * false otherwise
      */
     public static boolean hasThreadLocalContext() {
-        return !getContextStack().isEmpty();
+        ContextStack contextStack = THREAD_LOCAL_CONTEXT.get();
+        if (contextStack == null) {
+            return false;
+        }
+        return !contextStack.isEmpty();
     }
 
     /**
@@ -871,7 +875,7 @@ public class Context {
         Context context = contextStack.pop();
 
         if (contextStack.isEmpty()) {
-            THREAD_LOCAL_CONTEXT.set(null);
+            THREAD_LOCAL_CONTEXT.remove();
         }
 
         return context;



Mime
View raw message