diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-03-23 11:38:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-23 11:38:59 +0100 |
commit | 01bb39ac3fb0aa3b9435ffeab28ae66e39039860 (patch) | |
tree | ba217008453b969c1282d99127fe127590352f0a /scene/main/node.cpp | |
parent | 32c726f7cd3833db19eb1e5248f34d5e88b2cbdf (diff) | |
parent | 611c05046948693a7b23ca697f73b9217f1a7c6f (diff) |
Merge pull request #17321 from LinkDoyle/issue_16350
Fix switching WindowDialog types leaves garbage buttons
Diffstat (limited to 'scene/main/node.cpp')
-rw-r--r-- | scene/main/node.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index cf22383e36..28b4540573 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -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); |