summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2016-01-26 17:35:39 +0100
committerRémi Verschelde <remi@verschelde.fr>2016-01-26 17:35:39 +0100
commit62a574dad9cc9672da2554fb608bfcab17eef3c9 (patch)
tree24efcc407a4452386ccd73927199cd625a1ef56a /tools
parente5c5f58085b8f35f13234598667e306b107f1f56 (diff)
parent081df6e8bab251232db9382d29157173aaf8dbac (diff)
Merge pull request #3458 from TheHX/pr-issue-3457
Fix crash when renaming nodes using focus loss
Diffstat (limited to 'tools')
-rw-r--r--tools/editor/scene_tree_editor.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/editor/scene_tree_editor.cpp b/tools/editor/scene_tree_editor.cpp
index 0260457c81..ba5cc7568b 100644
--- a/tools/editor/scene_tree_editor.cpp
+++ b/tools/editor/scene_tree_editor.cpp
@@ -658,6 +658,9 @@ void SceneTreeEditor::_renamed() {
new_name=n->get_name();
}
+ if (new_name==n->get_name())
+ return;
+
if (!undo_redo) {
n->set_name( new_name );
which->set_metadata(0,n->get_path());
@@ -844,7 +847,7 @@ SceneTreeEditor::SceneTreeEditor(bool p_label,bool p_can_rename, bool p_can_open
add_child( tree );
tree->connect("cell_selected", this,"_selected_changed");
- tree->connect("item_edited", this,"_renamed");
+ tree->connect("item_edited", this,"_renamed",varray(),CONNECT_DEFERRED);
tree->connect("multi_selected",this,"_cell_multi_selected");
tree->connect("button_pressed",this,"_cell_button_pressed");
// tree->connect("item_edited", this,"_renamed",Vector<Variant>(),true);