Search Issue Tracker
Won't Fix
Votes
0
Found in
2020.3.48f1
2021.3.25f1
2022.2.16f1
2023.1.0b16
2023.2.0a13
2023.3.0a3
6000.0.0b11
Issue ID
UUM-35574
Regression
No
Crash on AddComponentUnchecked when running tests and DestroyImmediate() is used
Reproduction steps:
1. Open the attached project “CrashRepro“
2. Open the Test Runner window
3. Click on the “Run All” button
Expected result: Tests run
Actual result: Editor crashes
Reproducible with: 2020.3.48f1, 2021.3.25f1, 2022.2.16f1, 2023.1.0b16, 2023.2.0a13
Reproducible on: Windows 10
First few lines of the stack trace:
{noformat}0x00007ff6da603c8f (Unity) AddComponentUnchecked
0x00007ff6da6036f7 (Unity) AddComponent
0x00007ff6da89fdf6 (Unity) MonoAddComponentWithType
0x00007ff6d9adf1f7 (Unity) GameObject_CUSTOM_Internal_AddComponentWithType
0x00000248ffa420cc (Mono JIT Code) (wrapper managed-to-native) UnityEngine.GameObject:Internal_AddComponentWithType (UnityEngine.GameObject,System.Type){noformat}
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
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
Issue is related to the incorrect usage of Singletons in the user's project. To ensure the objects in your code have a proper lifecycle, make sure you:
1. Use Destroy() instead of DestroyImmediate() in the runtime.
2. Do a cleanup after your tests finish executing.