From: luozheng <1732036298@qq.com> Date: Sat, 25 Apr 2026 08:37:54 +0000 (+0800) Subject: 解决弧形列表,蜂窝,直线列表,内存泄漏问题 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=bd29d906cbec2b1037cc6422dbb3ef77c9ef8969;p=mirrors%2FFD230.git 解决弧形列表,蜂窝,直线列表,内存泄漏问题 --- diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ArcScaleListDesktopFragment.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ArcScaleListDesktopFragment.cpp index 1282029e9..121b37e1a 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ArcScaleListDesktopFragment.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ArcScaleListDesktopFragment.cpp @@ -137,6 +137,7 @@ void ArcScaleListDesktopFragment::OnDestroyView() ClearAppItemToList(); if (ArcScaleList_ != nullptr) { + fragmentView_.Remove(ArcScaleList_); delete ArcScaleList_; ArcScaleList_ = nullptr; } @@ -153,7 +154,10 @@ void ArcScaleListDesktopFragment::OnDestroyView() bool ArcScaleListDesktopFragment::OnClick(UIView &view, const ClickEvent &event) { UNUSED(event); - AppItemView *itemView = dynamic_cast(&view); + ArcScaleListItemView *itemView = dynamic_cast(&view); + if (itemView == nullptr && view.GetParent() != nullptr) { + itemView = dynamic_cast(view.GetParent()); + } if (itemView == nullptr) { WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "itemView is nullptr"); return false; diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/HexagonsDesktopFragment.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/HexagonsDesktopFragment.cpp index 51ada6642..67725ff96 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/HexagonsDesktopFragment.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/HexagonsDesktopFragment.cpp @@ -39,6 +39,7 @@ void HexagonsDesktopFragment::OnDestroyView() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "HexagonsDesktopFragment::OnDestroyView"); ClearAppItemToList(); if (hexagonsList_ != nullptr) { + fragmentView_.Remove(hexagonsList_); delete hexagonsList_; hexagonsList_ = nullptr; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ListDesktopFragment.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ListDesktopFragment.cpp index 104b1fffc..538396b7f 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ListDesktopFragment.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ListDesktopFragment.cpp @@ -64,6 +64,7 @@ void ListDesktopFragment::OnDestroyView() listAdapter_ = nullptr; } if (contentList_ != nullptr) { + fragmentView_.Remove(contentList_); delete contentList_; contentList_ = nullptr; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/PlanetDesktopFragment.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/PlanetDesktopFragment.cpp index 55ef30d06..2348afdd6 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/PlanetDesktopFragment.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/PlanetDesktopFragment.cpp @@ -34,6 +34,7 @@ void PlanetDesktopFragment::OnDestroyView() WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "PlanetDesktopFragment::OnDestroyView"); ClearAppItemToList(); if (planetList_ != nullptr) { + fragmentView_.Remove(planetList_); delete planetList_; planetList_ = nullptr; } diff --git a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleCatalog.cpp b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleCatalog.cpp index 5d2f1f87f..8ff59483d 100644 --- a/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleCatalog.cpp +++ b/code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleCatalog.cpp @@ -163,9 +163,6 @@ ThemeStyle GetThemeStyleDropdownNextStyle(ThemeStyle current) return ThemeStyle::HEXAGONS_STYLE; } if (norm == ThemeStyle::HEXAGONS_STYLE) { - return ThemeStyle::PLANET_STYLE; - } - if (norm == ThemeStyle::PLANET_STYLE) { return ThemeStyle::APPLIST_STYLE; } return ThemeStyle::APPLIST_STYLE;