From e3ca2d8166cf74b2b0072ce491e9a4275a98b1cc Mon Sep 17 00:00:00 2001 From: Sunghyun Kim Date: Thu, 10 Dec 2020 14:55:06 +0900 Subject: [PATCH] Check renderer when call DisplayNextFrame() Sometimes DisplayNextFrame() is called even if animatedImageVisual is disposed. for avoid this issue, i added this patch. Change-Id: I4912dbc38e2c911bc7bbfe7815a8fc8f6b9f4d37 --- .../visuals/animated-image/animated-image-visual.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp index cb900a4..5a83d92 100755 --- a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp @@ -510,6 +510,7 @@ void AnimatedImageVisual::DoSetOffScene( Actor& actor ) actor.RemoveRenderer( mImpl->mRenderer ); mImpl->mRenderer.Reset(); mPlacementActor.Reset(); + mStartFirstFrame = false; } void AnimatedImageVisual::OnSetTransform() @@ -608,12 +609,13 @@ void AnimatedImageVisual::StartFirstFrame( TextureSet& textureSet ) if(mImpl->mRenderer) { mImpl->mRenderer.SetTextures( textureSet ); - } - Actor actor = mPlacementActor.GetHandle(); - if( actor ) - { - actor.AddRenderer( mImpl->mRenderer ); - mPlacementActor.Reset(); + + Actor actor = mPlacementActor.GetHandle(); + if( actor ) + { + actor.AddRenderer( mImpl->mRenderer ); + mPlacementActor.Reset(); + } } if( mFrameCount > 1 ) @@ -764,7 +766,10 @@ bool AnimatedImageVisual::DisplayNextFrame() if( textureSet ) { SetImageSize( textureSet ); - mImpl->mRenderer.SetTextures( textureSet ); + if( mImpl->mRenderer ) + { + mImpl->mRenderer.SetTextures( textureSet ); + } } continueTimer = ( mActionStatus == DevelAnimatedImageVisual::Action::PLAY ) ? true : false; -- 2.7.4