Search Issue Tracker
Fixed
Fixed in 2023.3.X
Votes
0
Found in
2023.2.7f1
2023.3.0b4
Issue ID
UUM-61437
Regression
Yes
A "Destroy may not be called from edit mode! Use DestroyImmediate instead." error is thrown when disabling a UI Document Component after entering and exiting the Play Mode
Reproduction steps:
1. Open the attached "benchmark-tdd-asteroids" project
2. Open "Assets/Scenes/02_Options" scene
3. In the Hierarchy window, expand the "MenuBase" GameObject and click on the "OptionsMenu" GameObject
4. In the Inspector window, disable the "UI Document" Component
5. Observe the Console Logs to see that no errors were thrown
6. Enable the "UI Document" Component
7. Enter and exit the Play Mode
8. Disable the "UI Document" Component
9. Observe the Console Logs
Expected results: The "Destroy may not be called from edit mode! Use DestroyImmediate instead." error is not thrown
Actual results: The "Destroy may not be called from edit mode! Use DestroyImmediate instead." error is thrown
Reproducible with: 2023.2.0a21, 2023.2.7f1, 2023.3.0b4
Not reproducible with: 2021.3.34f1, 2022.3.18f1, 2023.2.0a20
Reproducible on: Windows 11 Pro, MacOS 14.1 (user's)
Not reproducible on: No other environments tested
Notes:
- The error is not thrown when disabling the UI Document Component in Play Mode
- The error is also thrown upon entering the Play Mode for the second time and subsequently
- Reproducible in Standalone Player by simply doing "Build and Run"
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Required SpriteMask class (ID 331) is stripped when "Strip Engine Code" is enabled
- “Maximized serialized file backup not found” error is thrown when minimizing a window in a newly opened project
- Build stack trace contains invalid lines when building with IL2CPP using scripts with delegates containing generic types in the signature
- Entities Systems window has a “Show Full Player Loop” dropdown which does nothing when clicked after enabling “Show Full Player Loop”
- Entities Hierarchy Search “Show/Hide” button’s Lens Icon is blurry when the Editor is on an external monitor
Resolution Note:
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-695
Resolution Note (fix version 2023.3):
Fixed by https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-695