Search Issue Tracker
Fixed in 2019.3.X
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2018.4.4f1
2019.1.0a1
2019.2.0a1
2019.3.0a1
Issue ID
1170742
Regression
No
Crash on RendererScene::SceneAfterCullingOutputReady when using GameObject.DestroyImmediate()
How to reproduce:
1. Open the Scene "reproduction" in the attached "case_1170742.zip" Unity project
2. Enter Play Mode and wait
3. Observe the crash
Reproducible with: 2017.4.31f1, 2018.4.5f1, 2019.1.13f1, 2019.2.0f1, 2019.3.0a11
Note: it might take more than one attempt of entering Play Mode to reproduce the crash. If GameObject.DestroyImmediate() is swapped with GameObject.Destroy() in ObiRope.cs (line 64 and line 65), the crash is not reproducible.
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
- Missing Render Feature "Full Screen Pass Render Feature" in any “Universal Renderer Data” asset when upgrading from 2022.3
- Inconsistent ParticleSystemVertexStream.PercentageAlongTrail data range in Trail Texture Modes except "Stretch"
- The Graph Debug Window can be right clicked through and the Node Workspace is manipulated instead
- [Linux] Top left corner of the screen is unresponsive when the Editor recompiles
- [Android] [Vulkan] Cubes stuck on the first few frames of rotation and application flickering when an Overlay Camera is added to the Camera Stack with MSAA enabled
Resolution Note (fix version 2019.3):
We cannot add or destroy renderers after culling has started. DestroyImmediate bypasses this and destroys a renderer that is currently being rendered. This results in a crash. Destroy should be used instead of DestroyImmediate, this destroys the object when it is safe and rendering has finished. With the fix an error message will now be shown when attempting to call Destroy Immediate from one of the rendering call backs. The error message will recommend the use of Destroy instead. The editor should not longer crash when this happens.
https://docs.unity3d.com/ScriptReference/Object.DestroyImmediate.html.
Unity no longer crashes in 2020.1.0a22 - instead, an error is thrown indicating that "Destroy" should be used.