How to reproduce:
1. Open the attached “IN-146390” project
2. Select File → Build Profiles
3. In the Build Profiles window, enable “Development Build”
4. Build and run the project
5. Quit the built application
6. Open the “Player.log”
7. Observe the error near the end of the log
Actual result: Exception “InvalidOperationException: Cannot release resources while the VisualElement is still in the hierarchy” is logged
Expected result: No exceptions are logged
Reproducible with: 6000.5.0a8, 6000.5.2f1, 6000.6.0a1 (b0e692525f04)
Not reproducible with: 6000.0.78f1, 6000.3.19f1, 6000.5.0a7, 6000.6.0b2, 6000.7.0a1
Fixed in: 6000.6.0a2 (64de5ee36373)
Reproducible on: Windows 11
Not reproducible on: No other environments tested
Notes:
- Only reproduces in the Player
- Full error logged in the Player.log:
InvalidOperationException: Cannot release resources while the VisualElement is still in the hierarchy
at UnityEngine.UIElements.VisualElement.ReleaseResources () [0x00048] in C:\build\output\unity\unity\Modules\UIElements\Core\VisualElement.cs:1927
at UnityEngine.UIElements.PanelRenderer.OnPanelRendererCleanup () [0x00038] in C:\build\output\unity\unity\Modules\UIElements\Core\Native\Renderer\PanelRenderer.bindings.cs:452