From e396a42c0185be1331eddb5569b84968fb1510f3 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Fri, 29 Nov 2019 17:11:30 +0900 Subject: [PATCH] [Tizen](Vector) Fix crash issues Change-Id: I881285162317da9b095b0e29dabba1936b8f4b31 --- .../animated-vector-image/animated-vector-image-visual.cpp | 3 ++- .../visuals/animated-vector-image/vector-animation-task.cpp | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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 4a73a08..f5d707f 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 @@ -118,7 +118,8 @@ AnimatedVectorImageVisual::AnimatedVectorImageVisual( VisualFactoryCache& factor AnimatedVectorImageVisual::~AnimatedVectorImageVisual() { - // Finalize animation task in the main thread + // Finalize animation task and disconnect the signal in the main thread + mVectorAnimationTask->UploadCompletedSignal().Disconnect( this, &AnimatedVectorImageVisual::OnUploadCompleted ); mVectorAnimationTask->Finalize(); } diff --git a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp index 213051f..7cfce6b 100644 --- a/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp +++ b/dali-toolkit/internal/visuals/animated-vector-image/vector-animation-task.cpp @@ -95,6 +95,8 @@ VectorAnimationTask::~VectorAnimationTask() void VectorAnimationTask::Finalize() { + ConditionalWait::ScopedLock lock( mConditionalWait ); + // Release some objects in the main thread if( mAnimationFinishedTrigger ) { @@ -417,7 +419,7 @@ void VectorAnimationTask::Initialize() bool VectorAnimationTask::Rasterize() { - bool stopped = false, needAnimationFinishedTrigger; + bool stopped = false, needAnimationFinishedTrigger, resourceReady; uint32_t currentFrame, startFrame, endFrame; int32_t loopCount, currentLoopCount; PlayState playState; @@ -437,6 +439,7 @@ bool VectorAnimationTask::Rasterize() currentLoopCount = mCurrentLoop; needAnimationFinishedTrigger = mNeedAnimationFinishedTrigger; playState = mPlayState; + resourceReady = mResourceReady; mResourceReady = true; mCurrentFrameUpdated = false; @@ -511,11 +514,19 @@ bool VectorAnimationTask::Rasterize() { DALI_LOG_INFO( gVectorAnimationLogFilter, Debug::Verbose, "VectorAnimationTask::Rasterize: Rendering failed. Try again later.[%d] [%p]\n", currentFrame, this ); mUpdateFrameNumber = false; + + if( !resourceReady ) + { + ConditionalWait::ScopedLock lock( mConditionalWait ); + mResourceReady = false; + } } } if( stopped && renderSuccess ) { + ConditionalWait::ScopedLock lock( mConditionalWait ); + mPlayState = PlayState::STOPPED; mForward = true; mCurrentLoop = 0; -- 2.7.4