BloodDetectionView::~BloodDetectionView()
{
WEARABLE_LOGD(WEARABLE_LOG_MODULE_APP, "BloodDetectionView::~BloodDetectionView");
- // container_->RemoveAll();
-
- delete titleLabel;
- titleLabel = nullptr;
-
- delete testButton;
- testButton = nullptr;
-
- imageAnimator->Stop();
- delete imageAnimator;
- imageAnimator = nullptr;
-
- delete Spo2Text;
- Spo2Text = nullptr;
-
- g_pBloodCheckView = this;
+ if(container_)
+ container_->RemoveAll();
+ if(titleLabel)
+ {
+ delete titleLabel;
+ titleLabel = nullptr;
+ }
+ if(testButton)
+ {
+ delete testButton;
+ testButton = nullptr;
+ }
+ if(imageAnimator)
+ {
+ imageAnimator->Stop();
+ delete imageAnimator;
+ imageAnimator = nullptr;
+ }
+ if(Spo2Text)
+ {
+ delete Spo2Text;
+ Spo2Text = nullptr;
+ }
+ g_pBloodCheckView = nullptr;
}
BloodDetectionView *BloodDetectionView::GetInstance(void)
{
*/
void BloodResultView::DeInit()
{
+ if(container_)
+ {
+ container_->RemoveAll();
+ }
if (background != nullptr)
{
delete background;
delete titleLabel;
titleLabel = nullptr;
}
+ if(checkButton!=nullptr)
+ {
+ delete checkButton;
+ checkButton = nullptr;
+ }
}
void BloodResultView::OnStart()