From 77e0fd5cf7dd35324a7c3a43f2004fb923c6254c Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 16 Feb 2022 23:41:28 +0800 Subject: ... --- include/cru/ui/components/Component.h | 5 ++--- include/cru/ui/controls/Control.h | 2 ++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/cru/ui/components/Component.h b/include/cru/ui/components/Component.h index 795d0db0..64c3ef47 100644 --- a/include/cru/ui/components/Component.h +++ b/include/cru/ui/components/Component.h @@ -4,9 +4,8 @@ namespace cru::ui::components { /** * \brief A component is a composition of controls. - * \remarks In destructor, component should remove root control from its parent - * by calling Control::RemoveFromParent. It should respect children's - * Component::IsDeleteByParent value and decide whether to delete it. + * \remarks Component should respect children's Component::IsDeleteByParent + * value and decide whether to delete it. */ class CRU_UI_API Component : public Object { public: diff --git a/include/cru/ui/controls/Control.h b/include/cru/ui/controls/Control.h index 4dad4549..3293969d 100644 --- a/include/cru/ui/controls/Control.h +++ b/include/cru/ui/controls/Control.h @@ -157,6 +157,8 @@ class CRU_UI_API Control : public Object { host::WindowHost* new_host); private: + bool in_destruction_ = false; + Control* parent_ = nullptr; host::WindowHost* window_host_ = nullptr; -- cgit v1.2.3