From: Bowon Ryu Date: Fri, 26 Jul 2024 03:30:40 +0000 (+0900) Subject: Fix text visual destruction issue X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1876f6d44048200319ec73aaeb118c65f2d5dff;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fix text visual destruction issue In LoadComplete, first check whether the control is valid. Change-Id: I85ecdbf02210aa47e038a257797554cce1871e99 Signed-off-by: Bowon Ryu --- diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 8ca9e54..b9c166e 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -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(renderInfo.width), static_cast(renderInfo.height));