From: luozheng <1732036298@qq.com> Date: Fri, 27 Sep 2024 12:57:46 +0000 (+0800) Subject: 解决天气内存泄漏 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=a0b86f8f6de06fb68e4337a42fa02cbac7249db9;p=mirrors%2FFD230.git 解决天气内存泄漏 --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp index 6553338f1..2fcefe7c4 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp @@ -2,7 +2,7 @@ * @Author: luozheng 1732036298@qq.com * @Date: 2024-01-29 15:37:44 * @LastEditors: luozheng 1732036298@qq.com - * @LastEditTime: 2024-06-19 09:52:56 + * @LastEditTime: 2024-09-27 20:49:01 * @FilePath: /FD230/code/sdk/application/wearable/fd230app/nativeui/weather/src/GetWeatherDataErrorView.cpp */ #include "weather/include/GetWeatherDataErrorView.h" @@ -83,22 +83,19 @@ namespace OHOS void GetWeatherDataErrorView::ClearAll() { - scrollView->RemoveAll(); - - if (label != nullptr) - { - delete label; - label = nullptr; - } - - if (image != nullptr) - { - delete image; - image = nullptr; - } - if (scrollView != nullptr) { + scrollView->RemoveAll(); + if (label != nullptr) + { + delete label; + label = nullptr; + } + if (image != nullptr) + { + delete image; + image = nullptr; + } delete scrollView; scrollView = nullptr; } diff --git a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp index a95e8bba9..71c11c532 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/weather/src/WeatherReportView.cpp @@ -106,7 +106,7 @@ namespace OHOS // FreeImagePathsArray(HumidityPathsArray, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); FreeImageInfoArray(UVPathsArray, UVPaths, UV_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); - FreeImageInfoArray(UVPathsArray, WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); + FreeImageInfoArray(WindSpeedPathsArray, WindSpeedPaths, WINDSPEED_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); FreeImageInfoArray(HumidityPathsArray, HumidityPaths, HUMIDITY_IMAGE_ANIMATOR_VIEW_NUM_FRAMES); } }