summaryrefslogtreecommitdiffstats
path: root/server/src/com
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com')
-rw-r--r--server/src/com/vaadin/server/VaadinServiceSession.java5
-rw-r--r--server/src/com/vaadin/ui/UI.java3
2 files changed, 5 insertions, 3 deletions
diff --git a/server/src/com/vaadin/server/VaadinServiceSession.java b/server/src/com/vaadin/server/VaadinServiceSession.java
index de5accbfd0..92c06cdf46 100644
--- a/server/src/com/vaadin/server/VaadinServiceSession.java
+++ b/server/src/com/vaadin/server/VaadinServiceSession.java
@@ -742,7 +742,12 @@ public class VaadinServiceSession implements HttpSessionBindingListener,
Integer id = Integer.valueOf(ui.getUIId());
uIs.remove(id);
retainOnRefreshUIs.values().remove(id);
+
+ UI current = UI.getCurrent();
+ UI.setCurrent(ui);
ui.fireCleanupEvent();
+ ui.setSession(null);
+ UI.setCurrent(current);
}
/**
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index d57d38b371..c7627f71db 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -634,10 +634,7 @@ public abstract class UI extends AbstractComponentContainer implements
* For internal use only.
*/
public void fireCleanupEvent() {
- UI current = UI.getCurrent();
- UI.setCurrent(this);
fireEvent(new CleanupEvent(this));
- UI.setCurrent(current);
}
@Override