From 2eb34dfc3dd3ca718da6ebf049886b4ae140b332 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 19 Nov 2025 02:59:30 +0800 Subject: Remove all children when control destroyed. --- include/cru/ui/controls/Window.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/cru/ui/controls/Window.h') diff --git a/include/cru/ui/controls/Window.h b/include/cru/ui/controls/Window.h index a2ae01f9..3d3ff0b0 100644 --- a/include/cru/ui/controls/Window.h +++ b/include/cru/ui/controls/Window.h @@ -1,5 +1,6 @@ #pragma once #include "../render/StackLayoutRenderObject.h" +#include "ControlHost.h" #include "LayoutControl.h" #include @@ -9,6 +10,8 @@ #include #include +#include + namespace cru::ui::controls { class CRU_UI_API Window : public LayoutControl { @@ -31,7 +34,7 @@ class CRU_UI_API Window void SetGainFocusOnCreateAndDestroyWhenLoseFocus(bool value); private: - std::shared_ptr control_host_; + std::unique_ptr control_host_; Control* attached_control_; -- cgit v1.2.3