Reproduction steps:
1. Open the attached “ProfileCrash” project
2. Open the Profiler window (Window > Analysis > Profiling Window)
3. Toggle the “Deep Profile” multiple times
Expected result: Deep Profile gets toggled on/off
Actual result: Editor crashes after toggling “Deep Profile”
Reproducible with: 2021.2.0b16, 2021.3.13f1
Not reproducible with: 2021.2.0b15, 2022.3.8f1, 2023.1.11f1, 2023.2.0b7, 2023.3.0a3
Fixed in: 2021.3.14f1
Reproducible on: MacOS 13.5 (M1 Max), MacOS 13.4.1 (Intel), Windows 10
Not reproducible on: No other environment tested
First few lines of stack trace:
#0 0x00000103243dac in bool ScriptingInvocation::Invoke<bool>(ScriptingExceptionPtr*, bool)
#1 0x00000103cd8b4c in Editor::Progress::CancelCallbackHandler::Cancel() const
#2 0x00000103cd9498 in Editor::Progress::ProgressManager::CancelOperation(Editor::Progress::ProgressManager::ProgressItem&, bool)
#3 0x00000103cdd5a0 in Editor::Progress::ProgressManager::CancelManagedProgress()
#4 0x00000103cd90d4 in Editor::Progress::CancelBeforeDomainReloadManagedProgress()
#5 0x0000010272dae8 in CallbackArray::Invoke()
#6 0x0000010321b5dc in ProfilerCallbackInvoke<CallbackArray, &GlobalCallbacks::beforeDomainUnload>::Invoke(char const*)
#7 0x000001032168b0 in UnloadDomain()
Note: iOS module must be installed to reproduce this issue