修复通讯录内存泄漏 585/2
authorhcj <1224667075@qq.com>
Thu, 25 Jul 2024 06:40:21 +0000 (14:40 +0800)
committerhcj <1224667075@qq.com>
Thu, 25 Jul 2024 06:40:21 +0000 (14:40 +0800)
code/sdk/application/wearable/fd230app/nativeui/phone/src/MainPhoneView.cpp

index 2206cb0..8bc372e 100644 (file)
@@ -110,6 +110,11 @@ namespace OHOS
                     button_calllog_status[i] = nullptr;
                 }
             }
+            if(info)
+            {
+                delete info;
+                info=nullptr;
+            }
 
             if(hintCallsLabel)
             {
@@ -247,7 +252,8 @@ namespace OHOS
                 WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "CallerLogModel::GetInstance()->ListIsEmpty");
                 return;
             }
-
+            if(num>20)
+            num=20;
             MainPhoneView_ButtonConfig_ext_t buttonconfig;
             buttonconfig.x = 38;
             buttonconfig.y = 360;