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. --- src/ui/controls/Control.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/ui/controls/Control.cpp') diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp index cf0cc11f..93213ecf 100644 --- a/src/ui/controls/Control.cpp +++ b/src/ui/controls/Control.cpp @@ -27,6 +27,11 @@ Control::Control() { } Control::~Control() { + if (host::WindowHost::IsInEventHandling()) { + // Don't delete control during event handling. Use DeleteLater. + std::terminate(); + } + in_destruction_ = true; RemoveFromParent(); } -- cgit v1.2.3