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
- A submenu disappears on MacOS when the MenuItem method argument "isVariableFunction" is set to "false" and priority argument is set to "-1"
- The Sprite Library Editor window has an incorrect order of Sprites when the Sprites are reordered and the order saved
- Tilemap Tiles do not get lit up unless the Light Range is greater than the distance between the position of the Tile before the transformation and the Light Source when the Tile is transformed with Tilemap.SetTransformMatrix method
- The Editor and "Reloading Domain" windows are frozen when entering Play Mode
- Crash when attempting to create a custom FMOD DSP unit
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.