Fix text visual destruction issue
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 26 Jul 2024 03:30:40 +0000 (12:30 +0900)
committerBowon Ryu <bowon.ryu@samsung.com>
Fri, 26 Jul 2024 03:30:40 +0000 (12:30 +0900)
In LoadComplete, first check whether the control is valid.

Change-Id: I85ecdbf02210aa47e038a257797554cce1871e99
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
dali-toolkit/internal/visuals/text/text-visual.cpp

index 8ca9e54..b9c166e 100644 (file)
@@ -757,6 +757,14 @@ void TextVisual::LoadComplete(bool loadingSuccess, TextInformation textInformati
   {
     resourceStatus = Toolkit::Visual::ResourceStatus::READY;
 
+    Actor control = mControl.GetHandle();
+    if(!control)
+    {
+      // Nothing to do.
+      ResourceReady(Toolkit::Visual::ResourceStatus::READY);
+      return;
+    }
+
     Text::AsyncTextRenderInfo renderInfo = textInformation.renderInfo;
 
     if(parameters.requestType == Text::Async::COMPUTE_NATURAL_SIZE || parameters.requestType == Text::Async::COMPUTE_HEIGHT_FOR_WIDTH)
@@ -768,14 +776,6 @@ void TextVisual::LoadComplete(bool loadingSuccess, TextInformation textInformati
       }
     }
 
-    Actor control = mControl.GetHandle();
-    if(!control)
-    {
-      // Nothing to do.
-      ResourceReady(Toolkit::Visual::ResourceStatus::READY);
-      return;
-    }
-
     // Calculate the size of the visual that can fit the text.
     // The size of the text after it has been laid-out, size of pixel data buffer.
     Size layoutSize(static_cast<float>(renderInfo.width), static_cast<float>(renderInfo.height));