From: Caisking <3449750381@qq.com> Date: Tue, 2 Apr 2024 10:12:56 +0000 (+0800) Subject: 修复析构不完全的bug X-Git-Tag: release_V1.2.70_20241020_135402~1235^2 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=796ba0cf2fd6a325681e8e5b4adf55c233dd12fe;p=mirrors%2FFD230.git 修复析构不完全的bug --- diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp index 76fc84518..0579133a9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingDataView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -75,6 +75,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingDataView::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp index 349859a40..ac076655c 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEnddataView.cpp @@ -82,7 +82,7 @@ namespace OHOS scrollView1_->Add(image5_); // 初始化button - TraingModel::GetInstance()->InitButton(button1_, 42, 1319, 380, 100, BUTTONBACK); + TraingModel::GetInstance()->InitButton(button1_, 42, 1319 - 338, 380, 100, BUTTONBACK); button1_->SetOnClickListener(static_cast(TraingEnddataPresenter::GetInstance())); scrollView1_->Add(button1_); @@ -110,17 +110,17 @@ namespace OHOS label12_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x7f)); label18_->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x7f)); - TraingModel::GetInstance()->InitLabel(label13_, 146, 626- 338, 60, 40, "label18", "226%", DEFAULT_VECTOR_FONT_FILENAME, 40); + TraingModel::GetInstance()->InitLabel(label13_, 146, 626 - 338, 60, 40, "label18", "226%", DEFAULT_VECTOR_FONT_FILENAME, 40); label13_->SetTextColor(Color::GetColorFromRGBA(0x4f, 0xc3, 0x4c, 0xff)); - TraingModel::GetInstance()->InitLabel(label14_, 146, 756- 338, 60, 40, "label14", "05:45:46", DEFAULT_VECTOR_FONT_FILENAME, 40); + TraingModel::GetInstance()->InitLabel(label14_, 146, 756 - 338, 60, 40, "label14", "05:45:46", DEFAULT_VECTOR_FONT_FILENAME, 40); label14_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x8a, 0x36, 0xff)); - TraingModel::GetInstance()->InitLabel(label15_, 146, 886- 338, 60, 40, "label15", "8,301", DEFAULT_VECTOR_FONT_FILENAME, 40); + TraingModel::GetInstance()->InitLabel(label15_, 146, 886 - 338, 60, 40, "label15", "8,301", DEFAULT_VECTOR_FONT_FILENAME, 40); label15_->SetTextColor(Color::GetColorFromRGBA(0x36, 0x4a, 0xff, 0xff)); - TraingModel::GetInstance()->InitLabel(label16_, 146, 1016- 338, 60, 40, "label16", "144", DEFAULT_VECTOR_FONT_FILENAME, 40); + TraingModel::GetInstance()->InitLabel(label16_, 146, 1016 - 338, 60, 40, "label16", "144", DEFAULT_VECTOR_FONT_FILENAME, 40); label16_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x5a, 0x36, 0xff)); - TraingModel::GetInstance()->InitLabel(label17_, 146, 1146- 338, 60, 40, "label17", "中等强度", DEFAULT_VECTOR_FONT_FILENAME, 40); + TraingModel::GetInstance()->InitLabel(label17_, 146, 1146 - 338, 60, 40, "label17", "中等强度", DEFAULT_VECTOR_FONT_FILENAME, 40); label17_->SetTextColor(Color::GetColorFromRGBA(0xff, 0x5a, 0x36, 0xff)); - TraingModel::GetInstance()->InitLabel(label19_, 201, 1348- 338, 60, 40, "label19", "关闭", DEFAULT_VECTOR_FONT_FILENAME, 31); + TraingModel::GetInstance()->InitLabel(label19_, 201, 1348 - 338, 60, 40, "label19", "关闭", DEFAULT_VECTOR_FONT_FILENAME, 31); scrollView1_->Add(label1_); // scrollView1_->Add(label2_); @@ -147,9 +147,9 @@ namespace OHOS { image7_ = new UIImageView(); } - image7_->SetPosition(188, 1460); // widget's left position and top position - image7_->Resize(100, 100); // widget's width and height - image7_->SetViewId("image7"); // Set style + image7_->SetPosition(188, 1460 - 338); // widget's left position and top position + image7_->Resize(100, 100); // widget's width and height + image7_->SetViewId("image7"); // Set style // Add to rootView scrollView1_->Add(image7_); image7_->SetVisible(true); @@ -158,6 +158,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingEnddataView::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp index 18e43c786..015872ebc 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnote2View.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -67,6 +67,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingEndnote2View::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp index 53675c23f..e139db105 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingEndnoteView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -67,6 +67,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingEndnoteView::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp index f20944733..fb5d1f50b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingMusicView.cpp @@ -3,7 +3,7 @@ #include #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -36,6 +36,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingMusicView::DeInit() { + container_->RemoveAll(); // 删除容器 if (playersView != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp index 70580c9a2..3aa160720 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingNomalView.cpp @@ -65,6 +65,7 @@ namespace OHOS /* DeInit:删除组件*/ void TraingNomalView::DeInit() { + container_->RemoveAll(); if (sporttitle_ != nullptr) { delete sporttitle_; diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp index bc7ea09b7..072c1428a 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetCaluliView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -125,6 +125,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingSetCaluliView::DeInit() { + container_->RemoveAll(); // 删除Label if (label1_ != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp index c378c81cd..66f6d1ef2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetDistView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -126,6 +126,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingSetDistView::DeInit() { + container_->RemoveAll(); // 删除Label if (label1_ != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp index 8e282bb2b..b7bafcf94 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetSeptView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -125,6 +125,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingSetSeptView::DeInit() { + container_->RemoveAll(); // 删除Label if (label1_ != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp index ff770a7a6..1352893a1 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetTimeView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -125,6 +125,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingSetTimeView::DeInit() { + container_->RemoveAll(); // 删除Label if (label1_ != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp index 6d22528ec..e4b2ef04b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingSetView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -77,6 +77,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingSetView::DeInit() { + container_->RemoveAll(); // 删除Label if (label1_ != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp index 5f5a3f416..6b3343e8b 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingStrongView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -14,7 +14,6 @@ namespace OHOS { - static TraingStrongView *g_pTraingStrongView{nullptr}; TraingStrongView::TraingStrongView() @@ -33,7 +32,7 @@ namespace OHOS return g_pTraingStrongView; } - + /* InitView:初始化界面*/ void TraingStrongView ::InitView() { @@ -101,6 +100,7 @@ namespace OHOS /* DeInit:删除组件 */ void TraingStrongView::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) { diff --git a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp index d64c54b8f..bbe4e318f 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/traing/src/TraingWinView.cpp @@ -3,7 +3,7 @@ #include "common/image_cache_manager.h" #include "components/ui_label_ext.h" -#include"language/font/ui_resource_string.h" +#include "language/font/ui_resource_string.h" #include "UiConfig.h" #include "ui_resource_image.h" #include @@ -156,6 +156,7 @@ namespace OHOS /* DeInit:删除组件*/ void TraingWinView::DeInit() { + container_->RemoveAll(); UIView *view = static_cast(container_)->GetChildrenHead(); while (view != nullptr) {