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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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.