Unity Issue Tracker - UI Toolkit UI Documents are not unloaded correctly when switching Scenes
Closed
UUM-16365
UI Toolkit UI Documents are not unloaded correctly when switching Scenes
Unity: UI Toolkit Framework
Won't Fix
2023.2.X
2023.1.X
2022.2.X
2022.1.X
2021.3.X
2020.3.X
2022.1 has reached end of life so the issue will be fixed in a newer version.
Reproduction steps:
1. Open the user’s attached project
2. Enter Play Mode
3. Press the “space” button to enter the next Scene (notice it has UI elements)
4. Press the “space” button to change the Scene again
5. Open Window > Analysis > Memory Profiler
6. Capture New Snapshot
7. Go to Memory breakdown and notice that “halftone” and “noisebox” are still using memory
Expected result: Unused objects are cleaned from memory after changing Scenes
Actual result: Objects used in the earlier Scene are not cleaned from memory