]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8500 Avoid unregistering components that have been moved from one
authorArtur Signell <artur@vaadin.com>
Tue, 20 Mar 2012 10:01:50 +0000 (12:01 +0200)
committerArtur Signell <artur@vaadin.com>
Wed, 21 Mar 2012 13:27:54 +0000 (15:27 +0200)
connector to another

src/com/vaadin/terminal/gwt/client/ConnectorMap.java

index 4f8b5701cf097a466b5e5d4a948ba470b94c2209..6eb58940bf0164b09af43e21a2d26cf3d7182cd7 100644 (file)
@@ -194,7 +194,14 @@ public class ConnectorMap {
         if (connector instanceof ComponentContainerConnector) {
             for (ComponentConnector child : ((ComponentContainerConnector) connector)
                     .getChildren()) {
-                unregisterConnector(child);
+                if (child.getParent() == connector) {
+                    // Only unregister children that are actually connected to
+                    // this parent. For instance when moving connectors from one
+                    // layout to another and removing the first layout it will
+                    // still contain references to its old children, which are
+                    // now attached to another connector.
+                    unregisterConnector(child);
+                }
             }
         }
     }