diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-08-27 18:10:28 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-08-27 18:11:58 +0300 |
commit | ea1c43b087b92bba0a5e97e803feb9671996aebd (patch) | |
tree | ac99724d6049499c481b5ec8a569396e32274981 /server/src/com | |
parent | 3f4235c67fe174dad112fedcece85851fb83ef92 (diff) | |
download | vaadin-framework-ea1c43b087b92bba0a5e97e803feb9671996aebd.tar.gz vaadin-framework-ea1c43b087b92bba0a5e97e803feb9671996aebd.zip |
Discard reference state for invisible connectors (#9400)
Diffstat (limited to 'server/src/com')
-rw-r--r-- | server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java | 2 | ||||
-rw-r--r-- | server/src/com/vaadin/ui/ConnectorTracker.java | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 64a6e76e7e..81c497713b 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -1415,7 +1415,7 @@ public abstract class AbstractCommunicationManager implements Serializable { * @return <code>true</code> if the connector is visible to the client, * <code>false</code> otherwise */ - static boolean isVisible(ClientConnector connector) { + public static boolean isVisible(ClientConnector connector) { if (connector instanceof Component) { return isVisible((Component) connector); } else { diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index ad5990137c..b44189f838 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -26,6 +26,7 @@ import java.util.logging.Level; import java.util.logging.Logger; import com.vaadin.terminal.AbstractClientConnector; +import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; import com.vaadin.terminal.gwt.server.ClientConnector; /** @@ -69,8 +70,8 @@ public class ConnectorTracker implements Serializable { /** * Creates a new ConnectorTracker for the given uI. A tracker is always - * attached to a uI and the uI cannot be changed during the lifetime of - * a {@link ConnectorTracker}. + * attached to a uI and the uI cannot be changed during the lifetime of a + * {@link ConnectorTracker}. * * @param uI * The uI to attach to. Cannot be null. @@ -226,6 +227,14 @@ public class ConnectorTracker implements Serializable { uninitializedConnectors.remove(connector); diffStates.remove(connector); iterator.remove(); + } else if (!AbstractCommunicationManager.isVisible(connector) + && !uninitializedConnectors.contains(connector)) { + uninitializedConnectors.add(connector); + diffStates.remove(connector); + getLogger().fine( + "cleanConnectorMap removed state for " + + getConnectorAndParentInfo(connector) + + " as it is not visible"); } } @@ -236,8 +245,8 @@ public class ConnectorTracker implements Serializable { * * @param connector * The connector to lookup - * @return The uI the connector is attached to or null if it is not - * attached to any uI. + * @return The uI the connector is attached to or null if it is not attached + * to any uI. */ private UI getUIForConnector(ClientConnector connector) { if (connector == null) { |