Merge pull request #17321 from LinkDoyle/issue_16350

Fix switching WindowDialog types leaves garbage buttons
This commit is contained in:
Rémi Verschelde 2018-03-23 11:38:59 +01:00 committed by GitHub
commit 01bb39ac3f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2502,7 +2502,10 @@ void Node::replace_by(Node *p_node, bool p_keep_data) {
Node *child = get_child(0);
remove_child(child);
p_node->add_child(child);
if (!child->is_owned_by_parent()) {
// add the custom children to the p_node
p_node->add_child(child);
}
}
p_node->set_owner(owner);