解决弧形列表,蜂窝,直线列表,内存泄漏问题 3371/2
authorluozheng <1732036298@qq.com>
Sat, 25 Apr 2026 08:37:54 +0000 (16:37 +0800)
committerluozheng <1732036298@qq.com>
Sat, 25 Apr 2026 08:37:54 +0000 (16:37 +0800)
code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ArcScaleListDesktopFragment.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/HexagonsDesktopFragment.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/ListDesktopFragment.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/applist/src/PlanetDesktopFragment.cpp
code/sdk/application/wearable/n9/nativeapp/nativeui/themestyle/src/ThemeStyleCatalog.cpp

index 1282029..121b37e 100644 (file)
@@ -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<AppItemView *>(&view);
+    ArcScaleListItemView *itemView = dynamic_cast<ArcScaleListItemView *>(&view);
+    if (itemView == nullptr && view.GetParent() != nullptr) {
+        itemView = dynamic_cast<ArcScaleListItemView *>(view.GetParent());
+    }
     if (itemView == nullptr) {
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "itemView is nullptr");
         return false;
index 51ada66..67725ff 100644 (file)
@@ -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;
     }
index 104b1ff..538396b 100644 (file)
@@ -64,6 +64,7 @@ void ListDesktopFragment::OnDestroyView()
         listAdapter_ = nullptr;
     }
     if (contentList_ != nullptr) {
+        fragmentView_.Remove(contentList_);
         delete contentList_;
         contentList_ = nullptr;
     }
index 55ef30d..2348afd 100644 (file)
@@ -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;
     }
index 5d2f1f8..8ff5948 100644 (file)
@@ -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;