aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/Control.cpp')
-rw-r--r--src/ui/controls/Control.cpp5
1 files changed, 5 insertions, 0 deletions
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();
}