summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-09-21 10:42:02 +0200
committerGitHub <noreply@github.com>2017-09-21 10:42:02 +0200
commit2d05e102b7596d14e69a0b6a4a7577225d5af4f0 (patch)
tree2f4440a1923106a3f456391e71251cab35016558
parentd79ce05b91e0032c6178935c7c0757b9a258becc (diff)
parent4820dfc5707cf767314fa211b19af4e721d7a8df (diff)
Merge pull request #11447 from akien-mga/queue_delete
Let queue_free() work on nodes which are not in the scene tree
-rwxr-xr-xscene/main/node.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp
index 319f123da9..0ab41b40d8 100755
--- a/scene/main/node.cpp
+++ b/scene/main/node.cpp
@@ -2572,8 +2572,11 @@ void Node::print_stray_nodes() {
void Node::queue_delete() {
- ERR_FAIL_COND(!is_inside_tree());
- get_tree()->queue_delete(this);
+ if (is_inside_tree()) {
+ get_tree()->queue_delete(this);
+ } else {
+ SceneTree::get_singleton()->queue_delete(this);
+ }
}
Array Node::_get_children() const {