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
- Lightmaps are baked incorrectly for GameObjects when their Position is <=-2048 or >=2048 on any of the coordinates
- Sahder errors in Player when "Strict shader variant matching" is enabled and the rendering path is set to "Deferred"
- NullReferenceExceptions are being thrown when saving a ScriptableObject with an array of a type with a CustomPropertyDrawer that uses TrackPropertyValue
- Applied velocity is inconsistent when using Rigidbody AddForce() with ForceMode.VelocityChange
- Crash on AudioUtil_CUSTOM_HasAudioCallback when exiting Play Mode while the Inspector is displaying a GameObject with an empty script attached
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.