From 744e76ea172b9a0f06c20055714e8058592af0d2 Mon Sep 17 00:00:00 2001 From: Caisking <3449750381@qq.com> Date: Thu, 10 Oct 2024 19:03:51 +0800 Subject: [PATCH] =?utf8?q?=E7=B3=BB=E7=BB=9F=EF=BC=9A=E4=BF=AE=E5=A4=8D?= =?utf8?q?=E5=AF=86=E7=A0=81=E9=94=81=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../codedlock/include/CodedLockView.h | 2 +- .../nativeui/codedlock/src/CodedLockView.cpp | 72 ++++++++++++++++++- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockView.h b/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockView.h index be68eb6dd..0e64613b2 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockView.h +++ b/code/sdk/application/wearable/fd230app/nativeui/codedlock/include/CodedLockView.h @@ -76,7 +76,7 @@ namespace OHOS UILabelButton *button_eight{nullptr}; UILabelButton *button_nine{nullptr}; UILabelButton *button_zero{nullptr}; - UILabelButton *button_delete{nullptr}; + // UILabelButton *button_delete{nullptr}; UIImageView *point_one{nullptr}; UIImageView *point_two{nullptr}; diff --git a/code/sdk/application/wearable/fd230app/nativeui/codedlock/src/CodedLockView.cpp b/code/sdk/application/wearable/fd230app/nativeui/codedlock/src/CodedLockView.cpp index 84f23c01d..aa3ce14d0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/codedlock/src/CodedLockView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/codedlock/src/CodedLockView.cpp @@ -31,8 +31,76 @@ static const uint32_t defaultColor = 0xff191919; CodedLockView::CodedLockView() { g_pCodedLockView = this; } CodedLockView::~CodedLockView() { - UIViewGroup *tmpGroup = dynamic_cast(container_); - UIViewGroup::RemoveAndDeleteAllRecursively(tmpGroup); + // UIViewGroup *tmpGroup = dynamic_cast(container_); + // UIViewGroup::RemoveAndDeleteAllRecursively(tmpGroup); + + if (button_one) { + delete button_one; + button_one = nullptr; + } + if (button_two) { + delete button_two; + button_two = nullptr; + } + if (button_three) { + delete button_three; + button_three = nullptr; + } + if (button_four) { + delete button_four; + button_four = nullptr; + } + if (button_five) { + delete button_five; + button_five = nullptr; + } + if (button_six) { + delete button_six; + button_six = nullptr; + } + if (button_seven) { + delete button_seven; + button_seven = nullptr; + } + if (button_eight) { + delete button_eight; + button_eight = nullptr; + } + if (button_nine) { + delete button_nine; + button_nine = nullptr; + } + if (button_zero) { + delete button_zero; + button_zero = nullptr; + } + + + if (point_one) { + delete point_one; + point_one = nullptr; + } + if (point_two) { + delete point_two; + point_two = nullptr; + } + if (point_three) { + delete point_three; + point_three = nullptr; + } + if (point_four) { + delete point_four; + point_four = nullptr; + } + if (point_five) { + delete point_five; + point_five = nullptr; + } + if (point_six) { + delete point_six; + point_six = nullptr; + } + g_pCodedLockView = nullptr; } -- 2.17.1