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:
parent
02dbdccf0d
commit
440b7b6214
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue