Merge pull request #11447 from akien-mga/queue_delete
Let queue_free() work on nodes which are not in the scene tree
This commit is contained in:
commit
2d05e102b7
|
@ -2572,8 +2572,11 @@ void Node::print_stray_nodes() {
|
||||||
|
|
||||||
void Node::queue_delete() {
|
void Node::queue_delete() {
|
||||||
|
|
||||||
ERR_FAIL_COND(!is_inside_tree());
|
if (is_inside_tree()) {
|
||||||
get_tree()->queue_delete(this);
|
get_tree()->queue_delete(this);
|
||||||
|
} else {
|
||||||
|
SceneTree::get_singleton()->queue_delete(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Array Node::_get_children() const {
|
Array Node::_get_children() const {
|
||||||
|
|
Loading…
Reference in a new issue