From 427427b7e2275236d8b6c4e75320d5e7a5307c25 Mon Sep 17 00:00:00 2001 From: hengsin Date: Fri, 27 Jan 2023 17:48:42 +0800 Subject: [PATCH] IDEMPIERE-5520 Navigation between Tabs leave Detached DOM objects (Leak) (#1654) - Fix change role session error with nginx proxy - Minor refinement for change role UI --- .../WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java | 3 ++- .../src/org/adempiere/webui/desktop/DefaultDesktop.java | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java index 9937b58b1c..0d47749945 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/AdempiereWebUI.java @@ -630,8 +630,9 @@ public class AdempiereWebUI extends Window implements EventListener, IWeb //desktop cleanup IDesktop appDesktop = getAppDeskop(); + HttpSession session = httpRequest.getSession(); if (appDesktop != null) - appDesktop.logout(T -> {if (T) asyncChangeRole(httpRequest.getSession(), locale, properties);}); + appDesktop.logout(T -> {if (T) asyncChangeRole(session, locale, properties);}); } private void asyncChangeRole(HttpSession httpSession, Locale locale, Properties properties) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java index 9d9aa150de..01ab030566 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/desktop/DefaultDesktop.java @@ -823,6 +823,7 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria ((Tab)tabs.get( i )).close(); } AEnv.detachInputElement(layout); + layout.setVisible(false); //schedule async logout Executions.schedule(layout.getDesktop(), e -> asyncLogout(callback), new Event("onAsyncLogout")); } else {