From 7d74479ccaceb5a2eaa82b89016a9a45a5f3e181 Mon Sep 17 00:00:00 2001 From: Henri Sara Date: Mon, 10 Mar 2014 10:59:44 +0000 Subject: Revert "Fixes a memory leak on IE8 in LayoutManagerIE8 (#12688)" This reverts commit 024692835d1e2af1a4053821959f03f8d5eb4fcb. Change-Id: I19cf6ee66a21f7eb07d0f1fd8b9698ae88454700 --- client/src/com/vaadin/client/LayoutManager.java | 9 --------- client/src/com/vaadin/client/LayoutManagerIE8.java | 18 +++--------------- 2 files changed, 3 insertions(+), 24 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index 5b27031a29..1ced003146 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -74,15 +74,6 @@ public class LayoutManager { this.connection = connection; } - /** - * Returns the application connection for this layout manager. - * - * @return connection - */ - protected ApplicationConnection getConnection() { - return connection; - } - /** * Gets the layout manager associated with the given * {@link ApplicationConnection}. diff --git a/client/src/com/vaadin/client/LayoutManagerIE8.java b/client/src/com/vaadin/client/LayoutManagerIE8.java index b7973310db..a692f126a2 100644 --- a/client/src/com/vaadin/client/LayoutManagerIE8.java +++ b/client/src/com/vaadin/client/LayoutManagerIE8.java @@ -19,8 +19,8 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; -import com.google.gwt.dom.client.Node; import com.google.gwt.user.client.ui.RootPanel; /** @@ -39,12 +39,6 @@ public class LayoutManagerIE8 extends LayoutManager { private Map measuredSizes = new HashMap(); - // this method is needed to test for memory leaks (see - // LayoutMemoryUsageIE8ExtensionConnector) but can be private - private int getMeasuredSizesMapSize() { - return measuredSizes.size(); - } - @Override protected void setMeasuredSize(Element element, MeasuredSize measuredSize) { if (measuredSize != null) { @@ -68,18 +62,12 @@ public class LayoutManagerIE8 extends LayoutManager { @Override protected void cleanMeasuredSizes() { Profiler.enter("LayoutManager.cleanMeasuredSizes"); - - // #12688: IE8 was leaking memory when adding&removing components. - // Uses IE specific logic to figure if an element has been removed from - // DOM or not. For this the parent element of the current UI is needed. - // For removed elements the measured size is discarded. - Node rootNode = getConnection().getUIConnector().getWidget() - .getElement().getParentNode(); + Document document = RootPanel.get().getElement().getOwnerDocument(); Iterator i = measuredSizes.keySet().iterator(); while (i.hasNext()) { Element e = i.next(); - if (!rootNode.isOrHasChild(e)) { + if (e.getOwnerDocument() != document) { i.remove(); } } -- cgit v1.2.3