diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-10-27 17:19:46 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-10-27 15:24:46 +0000 |
commit | 1ee652d48c5e9a5fb5ea4e550492935689ce53f9 (patch) | |
tree | f504a92915e1adcb8631b227b04e272c8bbd4e98 | |
parent | 1b992700c2560bc78cdc7910d7bbf2c4a969af38 (diff) | |
download | vaadin-framework-1ee652d48c5e9a5fb5ea4e550492935689ce53f9.tar.gz vaadin-framework-1ee652d48c5e9a5fb5ea4e550492935689ce53f9.zip |
Fix VAbstractOrderedLayout widget removal race condition (#18703)7.6.0.beta1
Removing a widget that got moved to another layout occasionally caused
slot to lose track of related widget. As a result the layout never
created a new slot when the same widget is put back in there.
Change-Id: I0d8793324b8a5ac8a06aa2803ac8de22b90b7545
-rw-r--r-- | client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 34362c9c2b..1a36ba9c93 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -209,8 +209,10 @@ public class VAbstractOrderedLayout extends FlowPanel { * @return */ public void removeWidget(Widget widget) { - Slot slot = widgetToSlot.get(widget); - removeSlot(slot); + Slot slot = widgetToSlot.remove(widget); + if (slot != null) { + removeSlot(slot); + } } /** @@ -226,7 +228,6 @@ public class VAbstractOrderedLayout extends FlowPanel { */ protected void removeSlot(Slot slot) { remove(slot); - widgetToSlot.remove(slot.getWidget()); } /** |