解决产测中GPS测试内存泄漏 3375/1 3375/head 3376/target/1
authorluozheng <1732036298@qq.com>
Mon, 27 Apr 2026 08:21:20 +0000 (16:21 +0800)
committerluozheng <1732036298@qq.com>
Mon, 27 Apr 2026 08:21:20 +0000 (16:21 +0800)
code/sdk/zhihui/UI/producttest/src/testGPS.cpp

index 45698c6..3f7e0a1 100644 (file)
@@ -51,6 +51,9 @@ namespace OHOS
             GPS_TEST_timer = NULL;
         }
         
+        mainContainer->RemoveAll();
+        contentScrollView->RemoveAll();
+
         // 清理固定元素
         if(labelButton_next)
         {
@@ -98,7 +101,6 @@ namespace OHOS
         // 清理滚动内容区域
         if(contentScrollView)
         {
-            contentScrollView->RemoveAll();
             delete contentScrollView;
             contentScrollView=nullptr;
         }
@@ -106,7 +108,6 @@ namespace OHOS
         // 清理主容器
         if(mainContainer)
         {
-            mainContainer->RemoveAll();
             delete mainContainer;
             mainContainer=nullptr;
         }