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/components/Menu.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/cru/ui/components/Menu.h') diff --git a/include/cru/ui/components/Menu.h b/include/cru/ui/components/Menu.h index 92731f2e..a8a90ed7 100644 --- a/include/cru/ui/components/Menu.h +++ b/include/cru/ui/components/Menu.h @@ -70,7 +70,7 @@ class CRU_UI_API PopupMenu : public Component { public: controls::Control* GetRootControl() override; - controls::Window* GetPopup() { return popup_; } + controls::Window* GetPopup() { return popup_.get(); } Menu* GetMenu() { return &menu_; } // position relative to screen left top. @@ -86,7 +86,7 @@ class CRU_UI_API PopupMenu : public Component { private: controls::Control* attached_control_; - controls::Window* popup_; + std::unique_ptr popup_; Menu menu_; }; } // namespace cru::ui::components -- cgit v1.2.3