Skip to content

Conversation

@xuhuisheng
Copy link
Contributor

@xuhuisheng xuhuisheng commented Nov 18, 2025

Issue Description

When we move a instanced scene file cross different folders in FileSystemDock, we will call reload_scene() to reload both main.tscn and sub.tscn.

Currently, we call memdelete() to delete root node of scene immediately. It will be considered as an accidental deletion.

Because remove_scene() not only delete root node, but also delete whole scene, so it won't crash before.

Solution

We can change memdelete() to queue_free(), to free root node defer. In the current frame, we will delete relevant scene, then next frame won't consider root node cannot be deleted.

MRP

test-112880.zip

remove-root-node.webm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[4.6 dev4] Moving scene file opened in another scene tries to free root scene node

2 participants