(Vector) Fix deadlock issue during upload completed signal 64/291264/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 12 Apr 2023 09:26:44 +0000 (18:26 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 12 Apr 2023 09:26:44 +0000 (18:26 +0900)
Change-Id: I93f211147470224e5d3b07fab209979f31749a85

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

index f0210c8..66b6778 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -525,25 +525,31 @@ VectorAnimationRendererPlugin::UploadCompletedSignalType& TizenVectorAnimationRe
 
 void TizenVectorAnimationRenderer::NotifyEvent()
 {
-  Dali::Mutex::ScopedLock lock(mMutex);
-
-  if(mResourceReadyTriggered)
+  bool emitSignal = false;
   {
-    DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "Set Texture [%p]\n", this);
+    Dali::Mutex::ScopedLock lock(mMutex);
 
-    // Set texture
-    if(mRenderer && mRenderedTexture)
+    if(mResourceReadyTriggered)
     {
-      TextureSet textureSet = mRenderer.GetTextures();
-      textureSet.SetTexture(0, mRenderedTexture);
-    }
+      DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "Set Texture [%p]\n", this);
 
-    mResourceReadyTriggered = false;
+      // Set texture
+      if(mRenderer && mRenderedTexture)
+      {
+        TextureSet textureSet = mRenderer.GetTextures();
+        textureSet.SetTexture(0, mRenderedTexture);
+      }
 
+      mResourceReadyTriggered = false;
+      emitSignal              = true;
+    }
+
+    mPreviousTexture.Reset();
+  }
+  if(emitSignal)
+  {
     mUploadCompletedSignal.Emit();
   }
-
-  mPreviousTexture.Reset();
 }
 
 void TizenVectorAnimationRenderer::SetShader()