Browse Source

Merge pull request #36613 from akien-mga/tab-container-add-child-fix

Signals: tab_changed now is emitted when it's on scene tree
Rémi Verschelde 5 years ago
parent
commit
e66d519286
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/gui/tab_container.cpp

+ 1 - 1
scene/gui/tab_container.cpp

@@ -538,7 +538,7 @@ void TabContainer::add_child_notify(Node *p_child) {
 
 
 	update();
 	update();
 	p_child->connect_compat("renamed", this, "_child_renamed_callback");
 	p_child->connect_compat("renamed", this, "_child_renamed_callback");
-	if (first)
+	if (first && is_inside_tree())
 		emit_signal("tab_changed", current);
 		emit_signal("tab_changed", current);
 }
 }