diff options
author | John Ahlroos <john@vaadin.com> | 2013-02-21 15:55:57 +0200 |
---|---|---|
committer | John Ahlroos <john@vaadin.com> | 2013-02-21 15:55:57 +0200 |
commit | 834275130dce0fee314e2c5b0b092579ba3905a4 (patch) | |
tree | 04afb32714682eec56248016f5cf072a5a9f626e /server/src | |
parent | c2cd910f53bd55e3472b3eb11c32f0cd28e5ee8e (diff) | |
download | vaadin-framework-834275130dce0fee314e2c5b0b092579ba3905a4.tar.gz vaadin-framework-834275130dce0fee314e2c5b0b092579ba3905a4.zip |
Fixed memory leak in Tree #11053
Change-Id: I4c58367d4041b5e61989fca5be6b037f7f8e0c01
Diffstat (limited to 'server/src')
-rw-r--r-- | server/src/com/vaadin/ui/Tree.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java index 608c947d59..219b39020b 100644 --- a/server/src/com/vaadin/ui/Tree.java +++ b/server/src/com/vaadin/ui/Tree.java @@ -1670,4 +1670,21 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, return itemDescriptionGenerator; } + @Override + public void containerItemSetChange( + com.vaadin.data.Container.ItemSetChangeEvent event) { + + // Ensure removed items are cleaned up from expanded list + for (Object expandedItemId : expanded) { + if (getItem(expandedItemId) == null) { + expanded.remove(expandedItemId); + if (this.expandedItemId == expandedItemId) { + this.expandedItemId = null; + } + } + } + + super.containerItemSetChange(event); + } + } |