From b68f9f52a3ecdd8e379dd60ac1c1366e76695464 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 16 Nov 2025 17:48:39 +0800 Subject: Fix delete later related things. --- include/cru/ui/components/Component.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/cru/ui/components/Component.h') diff --git a/include/cru/ui/components/Component.h b/include/cru/ui/components/Component.h index 627e2d3c..6d31ae79 100644 --- a/include/cru/ui/components/Component.h +++ b/include/cru/ui/components/Component.h @@ -19,9 +19,7 @@ class CRU_UI_API Component : public Object, public DeleteLaterImpl { void SetDeleteByParent(bool delete_by_parent) { delete_by_parent_ = delete_by_parent; } - void DeleteIfDeleteByParent() const { - if (delete_by_parent_) delete this; - } + void DeleteIfDeleteByParent(bool delete_later = true); protected: void OnPrepareDelete() override; -- cgit v1.2.3