-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switching scene tabs duplicates nodes in the scene and eventually also leads to an editor crash. #89877
Comments
Can confirm will try bisect in a bit |
Regression from: Unsure if this caused it or just exposed an existing issue that didn't fire without this |
This comment was marked as outdated.
This comment was marked as outdated.
You don't need to play the project. Just save the instance scene and go back to the parent scene. This causes reloading the scene (to update the instance) and leads to the mentioned bug. The weird part is that it duplicates only one node from the scene 🤔 After enough repeats, I got the editor to freeze while spamming |
Well the crash seems specific to your scene. The bug is that nodes get duplicated, but depending on nodes, the end result might be different. |
It's due to an incorrect deletion sequence in the PR, writing a fix right now: Lines 725 to 727 in 2850ce2
|
Indeed, this should go from last to first. But this approach feels hacky in the first place, maybe we could add a bool to |
Indeed, will leave making a better fix for now, could push a trivial fix but sounds like this might be an issue with ownership in replaced nodes or similar, so let's see what deeper solution is needed |
Fixed a bug in the editor where the editor would duplicate elements if you switch tabs.
@Illauriel and I confirmed a bisect of #89447 Steps to reproduce:
I also had a suspicion that an internal node somewhere could cause an issue: I recall from debugging a different issue that the core function From my notes about replace_by:
I should try and repro + file the bug about replace_by, since it's probably a separate issue, but wanted to bring it up anyway just in case. |
Moving a |
It seems that it will appear as long as you save the sub-scene and switch to the main scene. Nodes will be duplicated only when the nodes meet the following conditions:
|
Tested versions
System information
Windows 11 - Vulkan - Nvidia RTX 4070 - intel i5 13600KF
Issue description
When switching scene tabs while running the project some nodes in the scene tree get duplicated and stay in, eventually leading to a crash after couple times of repeating.
Video: https://youtu.be/11MNyMQJlh0
Steps to reproduce
(7. Repeat this proces to duplicate more - you might need to always press the stop and play buttons for every duplication - and observe after couple duplications the editor hard crashes)
Minimal reproduction project (MRP)
Mrp.zip
EDIT(@lyuma + @Illauriel): simpler MRP and repro steps:
Another MRP: node-dupe-bug.zip
Steps to reproduce:
The reason play duplicates nodes is because the play button saves all scenes. Therefore saving is sufficient.
The text was updated successfully, but these errors were encountered: