There is a crash when destroying text-editor and the ResizePolicy is USE_NATURAL_SIZE.
textEditor.SetProperty(Dali::Actor::Property::WIDTH_RESIZE_POLICY, ResizePolicy::USE_NATURAL_SIZE);"
then close the application. the below exception appears.
ERROR: DALI: Assert (threadLocal) failed in: static Dali::Internal::ThreadLocalStorage& Dali::Internal::ThreadLocalStorage::Get()
Exception:
threadLocal
thrown at static Dali::Internal::ThreadLocalStorage& Dali::Internal::ThreadLocalStorage::Get()
terminate called after throwing an instance of 'Dali::DaliException'
The solution applied at RelayoutController::Get().
Checked if ThreadLocalStorage is created then proceed normally otherwise returns null
Because the ThreadLocalStorage::Get() only retrieves STL without checking if it exists.
The caller of RelayoutController::Get() should check if RelayoutController is not null.
There is only one place use this function and already checks if RelayoutController is not null.
Change-Id: I343ef47f03aa86babb4bdd19f95c3e7ccb211dff
RelayoutController* RelayoutController::Get()
{
- return &ThreadLocalStorage::Get().GetRelayoutController();
+ // There was crash when destroying actors and the ResizePolicy is USE_NATURAL_SIZE
+ // The ThreadLocalStorage::Get() only retrieve STL without checking if it exists.
+ // The caller of RelayoutController::Get() should check if RelayoutController is not null.
+ if(ThreadLocalStorage::Created())
+ {
+ return &ThreadLocalStorage::Get().GetRelayoutController();
+ }
+
+ return nullptr;
}
void RelayoutController::QueueActor(Internal::Actor* actor, RelayoutContainer& actors, Vector2 size)