Skip to content

Commit

Permalink
Merge pull request #8011 from neikeq/pr-issue-6602-1
Browse files Browse the repository at this point in the history
Fix connection errors when replacing node
  • Loading branch information
akien-mga authored Mar 13, 2017
2 parents b19b8f7 + d210ac6 commit 26c12de
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scene/main/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2498,8 +2498,11 @@ void Node::_replace_connections_target(Node *p_new_target) {

Connection &c = E->get();

c.source->disconnect(c.signal, this, c.method);
c.source->connect(c.signal, p_new_target, c.method, c.binds, c.flags);
if (c.flags & CONNECT_PERSIST) {
c.source->disconnect(c.signal, this, c.method);
ERR_CONTINUE(!p_new_target->has_method(c.method));
c.source->connect(c.signal, p_new_target, c.method, c.binds, c.flags);
}
}
}

Expand Down

0 comments on commit 26c12de

Please sign in to comment.