summaryrefslogtreecommitdiff
path: root/editor/scene_tree_editor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/scene_tree_editor.cpp')
-rw-r--r--editor/scene_tree_editor.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index e3ad740005..5ca3448693 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -379,6 +379,12 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
}
if (!keep) {
+ if (editor_selection) {
+ Node *n = get_node(item->get_metadata(0));
+ if (n) {
+ editor_selection->remove_node(n);
+ }
+ }
memdelete(item);
return false;
} else {