From 8feb15fc5ca65651e32c397792d4bf13acc6ebfe Mon Sep 17 00:00:00 2001 From: lisyarus Date: Thu, 25 Feb 2021 14:55:30 +0300 Subject: [PATCH] Set children parent in ui::container --- libs/ui/source/container.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/ui/source/container.cpp b/libs/ui/source/container.cpp index f51cac61..35e6a5f6 100644 --- a/libs/ui/source/container.cpp +++ b/libs/ui/source/container.cpp @@ -25,6 +25,7 @@ namespace psemek::ui } children_[index] = std::move(c); + if (children_[index]) children_[index]->set_parent(this); children_range_[index] = children_[index].get(); } @@ -59,6 +60,7 @@ namespace psemek::ui auto c = std::move(children_[index]); children_range_[index] = nullptr; + if (c) c->set_parent(nullptr); return c; }