]> source.dussan.org Git - vaadin-framework.git/commitdiff
Avoid infinite recursion when purging access queue (#12310)
authorLeif Åstrand <leif@vaadin.com>
Fri, 2 Aug 2013 13:03:15 +0000 (16:03 +0300)
committerVaadin Code Review <review@vaadin.com>
Mon, 5 Aug 2013 05:40:04 +0000 (05:40 +0000)
Change-Id: Id5029f6606ce508c5746af4e0fa3078283f511bf

server/src/com/vaadin/server/VaadinSession.java

index 8de01e22bca5bf7c749ada480f23223227662e4f..1f7a577a42f3b25c9a111672c8a372bcc6567b17 100644 (file)
@@ -903,12 +903,14 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
      */
     public void unlock() {
         assert hasLock();
+        boolean ultimateRelease = false;
         try {
             /*
              * Run pending tasks and push if the reentrant lock will actually be
              * released by this unlock() invocation.
              */
             if (((ReentrantLock) getLockInstance()).getHoldCount() == 1) {
+                ultimateRelease = true;
                 getService().runPendingAccessTasks(this);
 
                 for (UI ui : getUIs()) {
@@ -935,7 +937,7 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable {
          * actually released. This means that the queue should be purged again
          * if it is not empty after unlocking.
          */
-        if (!getPendingAccessQueue().isEmpty()) {
+        if (ultimateRelease && !getPendingAccessQueue().isEmpty()) {
             getService().ensureAccessQueuePurged(this);
         }
     }