From: Bowon Ryu Date: Tue, 5 Dec 2023 06:26:39 +0000 (+0900) Subject: [Tizen] Add log if destroyed visual get some signal X-Git-Tag: accepted/tizen/unified/20231205.171435~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a60864c46a7c814638bbbb5cbfc8cc3b428e857;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [Tizen] Add log if destroyed visual get some signal This reverts commit fda3dce2278522d02c5e80462025b26351381baa. --- diff --git a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp index 699c281..9311450 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp @@ -651,6 +651,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, mImageUrl.GetUrl().c_str()); + return; + } + AnimatedVectorImageVisualPtr self = this; // Keep reference until this API finished DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnAnimationFinished: action state = %d [%p]\n", mPlayState, this); @@ -675,6 +681,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, mImageUrl.GetUrl().c_str()); + return; + } + if(mAnimationData.resendFlag) { mVectorAnimationTask->SetAnimationData(mAnimationData); diff --git a/dali-toolkit/internal/visuals/image/image-visual.cpp b/dali-toolkit/internal/visuals/image/image-visual.cpp index 9e18e36..c190f00 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.cpp +++ b/dali-toolkit/internal/visuals/image/image-visual.cpp @@ -1042,6 +1042,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) { EnablePreMultipliedAlpha(textureInformation.preMultiplied); diff --git a/dali-toolkit/internal/visuals/svg/svg-visual.cpp b/dali-toolkit/internal/visuals/svg/svg-visual.cpp index 8d64c8f..15e4280 100644 --- a/dali-toolkit/internal/visuals/svg/svg-visual.cpp +++ b/dali-toolkit/internal/visuals/svg/svg-visual.cpp @@ -360,7 +360,11 @@ void SvgVisual::AddRasterizationTask(const Vector2& size) void SvgVisual::ApplyRasterizedImage(SvgTaskPtr task) { - SvgVisualPtr self = this; // Keep reference until this API finished + 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()) { diff --git a/dali-toolkit/internal/visuals/visual-base-impl.cpp b/dali-toolkit/internal/visuals/visual-base-impl.cpp index 4710df4..e270fa5 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-base-impl.cpp @@ -119,21 +119,21 @@ static bool IsTypeAvailableForBorderline(Toolkit::Visual::Type type) struct StringProperty { const char* const name; - Property::Index index; + Property::Index index; }; -StringProperty PROPERTY_NAME_INDEX_TABLE[]= -{ - {CUSTOM_SHADER, Toolkit::Visual::Property::SHADER}, - {TRANSFORM, Toolkit::Visual::Property::TRANSFORM}, - {PREMULTIPLIED_ALPHA, Toolkit::Visual::Property::PREMULTIPLIED_ALPHA}, - {MIX_COLOR, Toolkit::Visual::Property::MIX_COLOR}, - {OPACITY, Toolkit::Visual::Property::OPACITY}, - {VISUAL_FITTING_MODE, Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE}, - {BORDERLINE_WIDTH, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH}, - {BORDERLINE_COLOR, Toolkit::DevelVisual::Property::BORDERLINE_COLOR}, - {BORDERLINE_OFFSET, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET}, - {CORNER_RADIUS, Toolkit::DevelVisual::Property::CORNER_RADIUS}, - {CORNER_RADIUS_POLICY, Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY}, +StringProperty PROPERTY_NAME_INDEX_TABLE[] = + { + {CUSTOM_SHADER, Toolkit::Visual::Property::SHADER}, + {TRANSFORM, Toolkit::Visual::Property::TRANSFORM}, + {PREMULTIPLIED_ALPHA, Toolkit::Visual::Property::PREMULTIPLIED_ALPHA}, + {MIX_COLOR, Toolkit::Visual::Property::MIX_COLOR}, + {OPACITY, Toolkit::Visual::Property::OPACITY}, + {VISUAL_FITTING_MODE, Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE}, + {BORDERLINE_WIDTH, Toolkit::DevelVisual::Property::BORDERLINE_WIDTH}, + {BORDERLINE_COLOR, Toolkit::DevelVisual::Property::BORDERLINE_COLOR}, + {BORDERLINE_OFFSET, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET}, + {CORNER_RADIUS, Toolkit::DevelVisual::Property::CORNER_RADIUS}, + {CORNER_RADIUS_POLICY, Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY}, }; const uint16_t PROPERTY_NAME_INDEX_TABLE_COUNT = sizeof(PROPERTY_NAME_INDEX_TABLE) / sizeof(PROPERTY_NAME_INDEX_TABLE[0]); @@ -164,6 +164,7 @@ Visual::Base::Base(VisualFactoryCache& factoryCache, FittingMode fittingMode, To Visual::Base::~Base() { delete mImpl; + mImpl = nullptr; } void Visual::Base::Initialize()