Reproduction steps:
1. Open the attached project “ReproProject”
2. Open the “SampleScene” Scene
3. Enter the Play mode
4. Wait a few minutes
Expected result: Editor executes the script attached to the Scene
Actual result: Editor freezes/crashes
Reproducible with: 2020.3.42f1, 2021.3.14f1, 2022.1.24f1, 2022.2.1f1, 2023.1.0a21
Reproducible on: macOS Ventura 13.0.1 (M1), Windows 10
First lines of stack trace:
Windows:
0x00007ff78b2c208d (Unity) delete_object_internal_step1
0x00007ff78b2be6f0 (Unity) DestroySingleObject
0x00007ff78b5df52d (Unity) DestroyObjectHighLevel_Internal
0x00007ff78b5df0c4 (Unity) DestroyObjectHighLevel
0x00007ff78b59aa8a (Unity) BackgroundJobQueue::ExecuteMainThreadJobs
MacOS:
#0 0x0000010106aa38 in MemoryProfilerStats::UnregisterObject(Object*)
#1 0x0000010106a42c in profiler_unregister_object(Object*)
#2 0x00000100ccd598 in delete_object_internal_step1(Object*)
#3 0x00000100ccc8ac in DestroySingleObject(Object*)
#4 0x00000100ff832c in DestroyObjectHighLevel(Object*, bool)
#5 0x00000100fb7524 in BackgroundJobQueue::ExecuteMainThreadJobs()