/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
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)
Actor& actorImpl = GetImplementation(actor);
mRelayoutStack->PopBack();
- if(actorImpl.RelayoutRequired())
+ if(actorImpl.RelayoutRequired() && actorImpl.OnScene())
{
DALI_LOG_INFO(gLogFilter, Debug::General, "[Internal::RelayoutController::Relayout] Negotiating %p %s %s (%.2f, %.2f)\n", &actorImpl, actor.GetTypeName().c_str(), actor.GetProperty<std::string>(Dali::Actor::Property::NAME).c_str(), size.width, size.height);