From ecee0300be1de2d740dc58313a4f21b17605c4e8 Mon Sep 17 00:00:00 2001 From: luozheng <1732036298@qq.com> Date: Sat, 5 Oct 2024 19:35:36 +0800 Subject: [PATCH] =?utf8?q?=E8=A7=A3=E5=86=B3=E8=93=9D=E7=89=99=E8=80=B3?= =?utf8?q?=E6=9C=BA=E7=95=8C=E9=9D=A2=E5=86=85=E5=AD=98=E6=B3=84=E6=BC=8F?= =?utf8?q?=E9=97=AE=E9=A2=98=20=E8=A7=A3=E5=86=B3=E8=93=9D=E7=89=99?= =?utf8?q?=E8=80=B3=E6=9C=BA=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=A6=82=E6=9E=9C?= =?utf8?q?=E8=BF=9B=E5=85=A5=E6=90=9C=E7=B4=A2=E7=95=8C=E9=9D=A2=E5=BC=80?= =?utf8?q?=E5=90=AF=E5=AE=9A=E6=97=B6=E5=99=A8=E5=90=8E=EF=BC=8C=E6=8C=89?= =?utf8?q?=E6=8C=89=E9=94=AE=E6=9C=AA=E5=85=B3=E9=97=AD=E5=AE=9A=E6=97=B6?= =?utf8?q?=E5=99=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../bluetooth/src/BluetoothDeviceCaseListAdapter.cpp | 12 ++++++++---- .../nativeui/bluetooth/src/BluetoothPresenter.cpp | 9 +++++++++ .../bluetooth/src/TipsConnFailMessageView.cpp | 10 ++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp index f945029d2..5be4c75c0 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothDeviceCaseListAdapter.cpp @@ -17,10 +17,14 @@ namespace OHOS { BluetoothDeviceCaseListAdapter::~BluetoothDeviceCaseListAdapter() { WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BluetoothDeviceCaseListAdapter::~BluetoothDeviceCaseListAdapter"); - UIView::OnClickListener *click = item->GetOnClickListener(); - if (click != nullptr) { - delete click; - click = nullptr; + // UIView::OnClickListener *click = item->GetOnClickListener(); + // if (click != nullptr) { + // delete click; + // click = nullptr; + // } + if (listener != nullptr) { + delete listener; + listener = nullptr; } } diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp index aa5f2ff2a..503217724 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/BluetoothPresenter.cpp @@ -244,6 +244,15 @@ bool BluetoothPresenter::OnKeyAct(UIView &view, const KeyEvent &event) // 如果是power键就返回上一级 if (keyID == static_cast(ZliteKeyCode::ZLITE_KEY_POWER) && keyState == 1 && uapi_get_screen_state() == 0) { + //如果是按键退出,退出时需要做一些清理工作 + BluetoothEarPhoneView *bluetoothEarPhoneView = BluetoothEarPhoneView::GetInstance(); + if(bluetoothEarPhoneView) + { + bluetoothEarPhoneView->BtAnimatorStop(); //停止搜索动画 + bluetoothEarPhoneView->StopBtDiscovery();//停止定时器 + BluetoothModel::GetInstance()->SetTagConnectView(false); //清除标志位 + BluetoothModel::GetInstance()->SetTagScanDeviceClicked(false); + } NativeAbility::GetInstance().Back(); } return true; diff --git a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp index 8d125872f..5fdfd13f9 100644 --- a/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp +++ b/code/sdk/application/wearable/fd230app/nativeui/bluetooth/src/TipsConnFailMessageView.cpp @@ -46,6 +46,16 @@ namespace OHOS delete tipLabel; tipLabel = nullptr; } + if (conn_fail_Label) + { + delete conn_fail_Label; + conn_fail_Label = nullptr; + } + if (bluetoothNameLabel) + { + delete bluetoothNameLabel; + bluetoothNameLabel = nullptr; + } delete group; group = nullptr; } -- 2.17.1