From 84d02463fb0aa3da641713bdba3532fe74cd188f Mon Sep 17 00:00:00 2001 From: zhengjiangliang Date: Wed, 27 Jul 2022 11:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E5=88=A4=E7=A9=BA=E5=90=8E=E8=8E=B7?= =?UTF-8?q?=E5=8F=96token=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I584b18341befb756b17372d168c73aef837f4b3f Signed-off-by: zhengjiangliang --- wmserver/src/window_root.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wmserver/src/window_root.cpp b/wmserver/src/window_root.cpp index aafe53fa..0f868a4b 100644 --- a/wmserver/src/window_root.cpp +++ b/wmserver/src/window_root.cpp @@ -670,12 +670,12 @@ WMError WindowRoot::SetWindowMode(sptr& node, WindowMode dstMode) WMError WindowRoot::DestroyWindow(uint32_t windowId, bool onlySelf) { auto node = GetWindowNode(windowId); - auto token = node->abilityToken_; if (node == nullptr) { WLOGFW("Window mode is destroyed or not created"); return WMError::WM_OK; } WMError res; + auto token = node->abilityToken_; auto container = GetOrCreateWindowNodeContainer(node->GetDisplayId()); if (container != nullptr) { UpdateFocusWindowWithWindowRemoved(node, container); @@ -700,7 +700,8 @@ WMError WindowRoot::DestroyWindow(uint32_t windowId, bool onlySelf) HandleKeepScreenOn(id, false); DestroyWindowInner(node); } - if ((node != nullptr) && (node->abilityToken_ != token) && + if ((node != nullptr) && (node->GetWindowToken() != nullptr) && + (node->abilityToken_ != token) && (node->GetWindowType() == WindowType::WINDOW_TYPE_DIALOG)) { node->GetWindowToken()->NotifyDestroy(); }