Add an assert in ui::element::set_parent to prevent changing element's parent without removing from old parent first

This commit is contained in:
Nikita Lisitsa 2022-03-30 19:35:15 +03:00
parent 02dbdccf0d
commit 440b7b6214

View file

@ -9,7 +9,9 @@ namespace psemek::ui
void element::set_parent(element * parent)
{
if (!parent_ && parent && reshape_posted_)
assert(!parent_ || !parent);
if (parent && reshape_posted_)
parent->post_reshape();
parent_ = parent;