]> source.dussan.org Git - vaadin-framework.git/commitdiff
[merge from 6.7] #8597 Do not leave VWindow references in the static windowOrder...
authorAutomerge <automerge@vaadin.com>
Mon, 2 Apr 2012 10:19:29 +0000 (10:19 +0000)
committerAutomerge <automerge@vaadin.com>
Mon, 2 Apr 2012 10:19:29 +0000 (10:19 +0000)
svn changeset:23377/svn branch:6.8

src/com/vaadin/terminal/gwt/client/ui/VWindow.java

index de0106164100cb108e77986795a570185d7b91e7..103979927a49b7f93ce75a396078dcf7be81de90 100644 (file)
@@ -580,7 +580,7 @@ public class VWindow extends VOverlay implements Container,
     }
 
     private void setCursorProperties() {
-        if (!this.draggable) {
+        if (!draggable) {
             header.getStyle().setProperty("cursor", "default");
             footer.getStyle().setProperty("cursor", "default");
         } else {
@@ -686,6 +686,13 @@ public class VWindow extends VOverlay implements Container,
 
     @Override
     public void show() {
+        if (!windowOrder.contains(this)) {
+            // This is needed if the window is hidden and then shown again.
+            // Otherwise this VWindow is added to windowOrder in the
+            // constructor.
+            windowOrder.add(this);
+        }
+
         if (vaadinModality) {
             showModalityCurtain();
         }
@@ -734,6 +741,10 @@ public class VWindow extends VOverlay implements Container,
             hideModalityCurtain();
         }
         super.hide();
+
+        // Remove window from windowOrder to avoid references being left
+        // hanging.
+        windowOrder.remove(this);
     }
 
     private void setVaadinModality(boolean modality) {