mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-21 04:25:28 -04:00
在判空后获取token值
Change-Id: I584b18341befb756b17372d168c73aef837f4b3f Signed-off-by: zhengjiangliang <zhengjiangliang@huawei.com>
This commit is contained in:
@@ -670,12 +670,12 @@ WMError WindowRoot::SetWindowMode(sptr<WindowNode>& 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user