取消多余的遥控拍照的资源释放
authorCaisking <3449750381@qq.com>
Thu, 5 Sep 2024 07:10:46 +0000 (15:10 +0800)
committerCaisking <3449750381@qq.com>
Thu, 5 Sep 2024 07:10:46 +0000 (15:10 +0800)
code/sdk/application/wearable/fd230app/nativeui/takephotos/src/TakephotosView.cpp

index e998433..79eea09 100644 (file)
@@ -29,13 +29,19 @@ namespace OHOS
     TakephotosView::~TakephotosView()
     {
         // DeInit();
-        creamAnimator->Stop();
-        smileAnimator->Stop();
-        FreeImageInfoArray(creamimageInfos, creambasePath.c_str(), 50);
-        FreeImageInfoArray(smileimageInfos, smilebasePath.c_str(), 50);
-        ReleaseImageAnimatorSource(creamimageAnimatorInfo, 50);
+        PopupPhoto staust = TakephotosModel::GetInstance()->GetPopStaust();
+        if (staust == PopupPhoto::CreamPopup)
+        {
+            creamAnimator->Stop();
+            FreeImageInfoArray(creamimageInfos, creambasePath.c_str(), 50);
+        }
+        else
+        {
+            smileAnimator->Stop();
+            FreeImageInfoArray(smileimageInfos, smilebasePath.c_str(), 50);
+        }
         ReleaseImageAnimatorSource(smileimageAnimatorInfo, 50);
-
+        ReleaseImageAnimatorSource(creamimageAnimatorInfo, 50);
         UIViewGroup *tmpGroup = dynamic_cast<UIViewGroup *>(container_);
         UIViewGroup::RemoveAndDeleteAllRecursively(tmpGroup);