Search Issue Tracker

Won't Fix

Votes

0

Found in

2017.4.0f1

2018.2.8f1

2018.3.0a1

2019.1.0a1

2019.2.0a1

2019.3.0a1

Issue ID

1168375

Regression

No

Editor crashes at FindActiveLights when calling mPreviewRenderUtility.Cleanup

Shadows/Lights

-

Steps to reproduce:
1. Download 1168375_repro.zip
2. Select in tool/foo. It will open the new Editor window
3. Close the window

Results: Editor crash when calling PreviewRenderUtility.Cleanup() if InternalEditorUtility.SetCustomLighting is setup.

Reproduced with: 2019.3.0a9, 2019.2.0b10, 2019.1.11f1, 2018.4.4f1, 2017.4.30f1

========== OUTPUTTING STACK TRACE ==================

0x00007FF6A0A07F25 (Unity) FindBrightestDirectionalLight
0x00007FF6A0A0BD1A (Unity) Skybox::RenderSkybox
0x00007FF6A0A57998 (Unity) Camera::RenderSkybox
0x00007FF69FE7A169 (Unity) Camera::ClearEditorCamera
0x00007FF6A0730080 (Unity) Handles_CUSTOM_Internal_ClearCamera
0x00000227DC7F3D2E (Mono JIT Code) (wrapper managed-to-native) UnityEditor.Handles:Internal_ClearCamera (UnityEngine.Camera)
0x00000227DC7C12F3 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\Handles.cs:1318] UnityEditor.Handles:ClearCamera (UnityEngine.Rect,UnityEngine.Camera)
0x00000227DC7C0423 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:1858] UnityEditor.SceneView:DoClearCamera (UnityEngine.Rect)
0x00000227DB361083 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\SceneView\SceneView.cs:2316] UnityEditor.SceneView:OnGUI ()
<...>
========== END OF STACKTRACE ===========

Workaround is to change the following lines in the Foo.cs script from:

        mPreviewRenderUtility.camera.Render();
        var texture = mPreviewRenderUtility.EndPreview();
        InternalEditorUtility.RemoveCustomLighting();

to

        mPreviewRenderUtility.camera.Render();
        InternalEditorUtility.RemoveCustomLighting();
        var texture = mPreviewRenderUtility.EndPreview();

  1. Resolution Note (2019.3.X):

    User is using an unsupported internal class, marking as won't fix - workaround provided

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.