[Tizen] Add log if destroyed visual get some signal
authorseungho baek <sbsh.baek@samsung.com>
Thu, 14 Sep 2023 09:45:43 +0000 (18:45 +0900)
committerseungho baek <sbsh.baek@samsung.com>
Thu, 14 Sep 2023 09:45:49 +0000 (18:45 +0900)
This reverts commit 0c59020225b5de90c07e9d710e1ed48eccd544e4.

Change-Id: Ia3e7b2393e7bd339b553c927c3f1439c88ce867a

dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp

index 8da031335c0ee8eacca9f7f0df43910d8b4ed28d..c7bffb6bd972ac5af0be439491b59238c14ad414 100644 (file)
@@ -625,6 +625,12 @@ void AnimatedVectorImageVisual::OnResourceReady(VectorAnimationTask::ResourceSta
 
 void AnimatedVectorImageVisual::OnAnimationFinished()
 {
+  if(DALI_UNLIKELY(mImpl == nullptr))
+  {
+    DALI_LOG_ERROR("Fatal error!! already destroyed object callback called! AnimatedVectorImageVisual : %p, url : %s\n", this, mUrl.GetUrl().c_str());
+    return;
+  }
+
   DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnAnimationFinished: action state = %d [%p]\n", mPlayState, this);
 
   if(mPlayState != DevelImageVisual::PlayState::STOPPED)
@@ -647,6 +653,12 @@ void AnimatedVectorImageVisual::OnAnimationFinished()
 
 void AnimatedVectorImageVisual::SendAnimationData()
 {
+  if(DALI_UNLIKELY(mImpl == nullptr))
+  {
+    DALI_LOG_ERROR("Fatal error!! already destroyed object callback called! AnimatedVectorImageVisual : %p, url : %s\n", this, mUrl.GetUrl().c_str());
+    return;
+  }
+
   if(mAnimationData.resendFlag)
   {
     mVectorAnimationTask->SetAnimationData(mAnimationData);
index 2f0e800cd5aa88a372f8b8d27c8bcfeb626b16f6..a8746c228c9d05aa1277af9e71a0c7f9d9213b37 100644 (file)
@@ -1070,6 +1070,11 @@ void ImageVisual::FastLoadComplete(FastTrackLoadingTaskPtr task)
 void ImageVisual::LoadComplete(bool loadingSuccess, TextureInformation textureInformation)
 {
   Toolkit::Visual::ResourceStatus resourceStatus;
+  if(DALI_UNLIKELY(mImpl == nullptr))
+  {
+    DALI_LOG_ERROR("Fatal error!! already destroyed object callback called! ImageVisual : %p, url : %s\n", this, mImageUrl.GetUrl().c_str());
+    return;
+  }
   if(mImpl->mRenderer)
   {
     if(textureInformation.useAtlasing)
index 8f9919d44d912dec28e925d17534ed084ef455bf..724c18d20018cfd8cee298c7c343a1f4ea39d43a 100644 (file)
@@ -336,6 +336,11 @@ void SvgVisual::AddRasterizationTask(const Vector2& size)
 
 void SvgVisual::ApplyRasterizedImage(SvgTaskPtr task)
 {
+  if(DALI_UNLIKELY(mImpl == nullptr))
+  {
+    DALI_LOG_ERROR("Fatal error!! already destroyed object callback called! SvgVisual : %p, url : %s, task : %p\n", this, mImageUrl.GetUrl().c_str(), task.Get());
+    return;
+  }
   if(task->HasSucceeded())
   {
     PixelData rasterizedPixelData = task->GetPixelData();
index b4c7fc97df485b64ec8300d8b1069dc1f689bfd0..ddaca8c8e98c91436593577c17f258c0e3fe83aa 100644 (file)
@@ -127,6 +127,7 @@ Visual::Base::Base(VisualFactoryCache& factoryCache, FittingMode fittingMode, To
 Visual::Base::~Base()
 {
   delete mImpl;
+  mImpl = nullptr;
 }
 
 void Visual::Base::Initialize()