aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui')
-rw-r--r--include/cru/ui/controls/LayoutControl.h2
-rw-r--r--include/cru/ui/controls/SingleChildControl.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/cru/ui/controls/LayoutControl.h b/include/cru/ui/controls/LayoutControl.h
index 2ea6ef67..78cc4806 100644
--- a/include/cru/ui/controls/LayoutControl.h
+++ b/include/cru/ui/controls/LayoutControl.h
@@ -14,7 +14,7 @@ class LayoutControl : public Control {
LayoutControl(LayoutControl&& other) = delete;
LayoutControl& operator=(const LayoutControl& other) = delete;
LayoutControl& operator=(LayoutControl&& other) = delete;
- ~LayoutControl() override = default;
+ ~LayoutControl() override { ClearChildren(); }
public:
const std::vector<Control*>& GetChildren() const { return children_; }
diff --git a/include/cru/ui/controls/SingleChildControl.h b/include/cru/ui/controls/SingleChildControl.h
index e733c825..b2e58c5f 100644
--- a/include/cru/ui/controls/SingleChildControl.h
+++ b/include/cru/ui/controls/SingleChildControl.h
@@ -13,7 +13,7 @@ class SingleChildControl : public Control {
CRU_DELETE_COPY(SingleChildControl)
CRU_DELETE_MOVE(SingleChildControl)
- ~SingleChildControl() override {}
+ ~SingleChildControl() override { SetChild(nullptr); }
Control* GetChild() const { return child_; }
void SetChild(Control* child) {