mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Fixes crash on queue free scene node in editor
Update scene/main/node.cpp Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
parent
019889d1da
commit
63d1319674
1 changed files with 7 additions and 1 deletions
|
|
@ -279,7 +279,13 @@ void Node::_notification(int p_notification) {
|
|||
ERR_PRINT("Attempted to free a node that is currently added to the SceneTree from a thread. This is not permitted, use queue_free() instead. Node has not been freed.");
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (Engine::get_singleton()->is_editor_hint() && data.tree && this == data.tree->get_edited_scene_root()) {
|
||||
cancel_free();
|
||||
ERR_PRINT(vformat("Something attempted to free the root Node of a scene (\"%s\"). This is not supported inside the editor, so the Node was not freed.", get_name()));
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
if (data.owner) {
|
||||
_clean_up_owner();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue