Reproduction steps:
1. Open the attached "ReproProj" project
2. Open "Assets/Scenes/SampleScene"
3. Go to "Edit" -> "Project Settings" -> "Services", press on the “New link” button, and connect to an organization
4. In the Project Settings, go to "Services" -> "Cloud Diagnostics" and turn on Cloud Diagnostics
5. Build and Run Player
6. Press on the "Quit" button
7. Observe the results
Expected results: Player does not crash and exits properly
Actual results: Player crashes
Reproducible with: 2021.3.33f1, 2022.3.15f1, 2023.2.4f1, 2023.3.0a18
Reproducible on: Windows 11 Pro
Not reproducible on: No other environments tested
First few lines of the Stacktrace:
0x00007FFC6DF3F8B1 (UnityPlayer) DebugStringToFilePostprocessedStacktrace
0x00007FFC6DF3FC37 (UnityPlayer) DebugStringToFile
0x00007FFC6DAE2310 (UnityPlayer) UnityWebRequest::UnityWebRequest
0x00007FFC6DB5CAF9 (UnityPlayer) CrashReporting::CrashReporter::SendReport
0x00007FFC6DB5AF48 (UnityPlayer) CrashReporting::CrashReporter::HandleLog
Notes:
- Reproducible in a new project
- Commenting out the Exception in the OnDestroy() method stops the Player from crashing