Revert "(Vector) Fix a crash issue" 15/218515/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 25 Nov 2019 04:51:15 +0000 (13:51 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 25 Nov 2019 04:51:23 +0000 (13:51 +0900)
This reverts commit 161f26f8f6edcaa40b8ea94846e92b5d228c0556.

Change-Id: Idcfde644b799e035b418cd660990d8e071c32e9f

dali-extension/vector-animation-renderer/tizen-vector-animation-manager.cpp
dali-extension/vector-animation-renderer/tizen-vector-animation-renderer.cpp

index 557bdfd..c9e163c 100755 (executable)
@@ -74,16 +74,6 @@ void TizenVectorAnimationManager::RemoveEventHandler( TizenVectorAnimationEventH
       }
     }
   }
-
-  {
-    Dali::Mutex::ScopedLock lock( mMutex );
-
-    auto triggeredHandler = std::find( mTriggeredHandlers.begin(), mTriggeredHandlers.end(), &handler );
-    if( triggeredHandler != mTriggeredHandlers.end() )
-    {
-      mTriggeredHandlers.erase( triggeredHandler );
-    }
-  }
 }
 
 void TizenVectorAnimationManager::TriggerEvent( TizenVectorAnimationEventHandler& handler )
@@ -103,23 +93,16 @@ void TizenVectorAnimationManager::Process()
   OnEventTriggered();
 }
 
-// This function is called in the main thread.
 void TizenVectorAnimationManager::OnEventTriggered()
 {
-  std::vector< TizenVectorAnimationEventHandler* > handlers;
-
-  {
-    Dali::Mutex::ScopedLock lock( mMutex );
-
-    // Copy the list to the local variable and clear
-    handlers = mTriggeredHandlers;
-    mTriggeredHandlers.clear();
-  }
+  Dali::Mutex::ScopedLock lock( mMutex );
 
-  for( auto&& iter : handlers )
+  for( auto&& iter : mTriggeredHandlers )
   {
     iter->NotifyEvent();
   }
+
+  mTriggeredHandlers.clear();
 }
 
 } // namespace Plugin
index e5e92f0..70719c0 100755 (executable)
@@ -104,7 +104,7 @@ bool TizenVectorAnimationRenderer::Initialize( const std::string& url )
 
   TizenVectorAnimationManager::Get().AddEventHandler( *this );
 
-  DALI_LOG_ERROR( "TizenVectorAnimationRenderer::Initialize: file [%s] [%p]\n", url.c_str(), this );
+  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Initialize: file [%s] [%p]\n", url.c_str(), this );
 
   return true;
 }
@@ -130,7 +130,7 @@ void TizenVectorAnimationRenderer::SetRenderer( Renderer renderer )
     SetShader();
   }
 
-  DALI_LOG_ERROR( "TizenVectorAnimationRenderer::SetRenderer [%p]\n", this );
+  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::SetRenderer [%p]\n", this );
 }
 
 void TizenVectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
@@ -139,7 +139,7 @@ void TizenVectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
 
   if( mWidth == width && mHeight == height )
   {
-    DALI_LOG_ERROR( "TizenVectorAnimationRenderer::SetSize: Same size (%d, %d) [%p]\n", mWidth, mHeight, this );
+    DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::SetSize: Same size (%d, %d) [%p]\n", mWidth, mHeight, this );
     return;
   }
 
@@ -159,7 +159,7 @@ void TizenVectorAnimationRenderer::SetSize( uint32_t width, uint32_t height )
 
   mResourceReady = false;
 
-  DALI_LOG_ERROR( "TizenVectorAnimationRenderer::SetSize: width = %d, height = %d [%p]\n", mWidth, mHeight, this );
+  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::SetSize: width = %d, height = %d [%p]\n", mWidth, mHeight, this );
 }
 
 bool TizenVectorAnimationRenderer::Render( uint32_t frameNumber )
@@ -229,11 +229,9 @@ bool TizenVectorAnimationRenderer::Render( uint32_t frameNumber )
 
       TizenVectorAnimationManager::Get().TriggerEvent( *this );
 
-      DALI_LOG_ERROR( "TizenVectorAnimationRenderer::Render: Resource ready [current = %d] [%p]\n", frameNumber, this );
+      DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::Render: Resource ready [current = %d] [%p]\n", frameNumber, this );
     }
 
-    DALI_LOG_ERROR( "TizenVectorAnimationRenderer::Render: current = %d [%p]\n", frameNumber, this );
-
     return true;
   }
 
@@ -255,7 +253,7 @@ void TizenVectorAnimationRenderer::GetDefaultSize( uint32_t& width, uint32_t& he
   width = mDefaultWidth;
   height = mDefaultHeight;
 
-  DALI_LOG_ERROR( "TizenVectorAnimationRenderer::GetDefaultSize: width = %d, height = %d [%p]\n", width, height, this );
+  DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::GetDefaultSize: width = %d, height = %d [%p]\n", width, height, this );
 }
 
 void TizenVectorAnimationRenderer::GetLayerInfo( Property::Map& map ) const
@@ -284,7 +282,7 @@ void TizenVectorAnimationRenderer::NotifyEvent()
 
   if( mResourceReadyTriggered )
   {
-    DALI_LOG_ERROR( "TizenVectorAnimationRenderer::NotifyEvent: Set Texture [%p]\n", this );
+    DALI_LOG_RELEASE_INFO( "TizenVectorAnimationRenderer::NotifyEvent: Set Texture [%p]\n", this );
 
     // Set texture
     if( mRenderer )