From 184173a9b993c145a2782d9e2488b98221c749e1 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Thu, 17 Nov 2016 18:10:53 +0200 Subject: Guard agains duplicate calling of _ready when instanced in _enter_tree Fixes #6005 --- scene/main/node.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scene/main/node.cpp') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index f4fb48682c..bff3c3a089 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -166,6 +166,7 @@ void Node::_notification(int p_notification) { void Node::_propagate_ready() { + data.ready_notified=true; data.blocked++; for (int i=0;idata.ready_notified) { // No parent (root) or parent ready + _propagate_ready(); //reverse_notification(NOTIFICATION_READY); + } tree_changed_b=data.tree; @@ -2999,6 +3002,7 @@ Node::Node() { data.fixed_process=false; data.idle_process=false; data.inside_tree=false; + data.ready_notified=false; data.owner=NULL; data.OW=NULL; -- cgit v1.2.3 From b6eab006dbd21d25a664486809109fffa9533124 Mon Sep 17 00:00:00 2001 From: Bojidar Marinov Date: Thu, 17 Nov 2016 18:46:45 +0200 Subject: Do not emit NOTIFICATION_READY more than once (breaking change) Currently, there is no notification with the old behaviour, so probably breaks all cpp code relying on that notification as well. --- scene/main/node.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scene/main/node.cpp') diff --git a/scene/main/node.cpp b/scene/main/node.cpp index bff3c3a089..78a5cb7302 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -166,14 +166,16 @@ void Node::_notification(int p_notification) { void Node::_propagate_ready() { - data.ready_notified=true; data.blocked++; for (int i=0;i_propagate_ready(); } data.blocked--; - notification(NOTIFICATION_READY); + if(!data.ready_notified) { + data.ready_notified=true; + notification(NOTIFICATION_READY); + } } @@ -2663,9 +2665,7 @@ void Node::_set_tree(SceneTree *p_tree) { _propagate_enter_tree(); - if (!data.parent || data.parent->data.ready_notified) { // No parent (root) or parent ready - _propagate_ready(); //reverse_notification(NOTIFICATION_READY); - } + _propagate_ready(); //reverse_notification(NOTIFICATION_READY); tree_changed_b=data.tree; -- cgit v1.2.3