Crash on Playmode Stop while debugging scripts, only when something causes FMOD to log into console

Hi,
Unity 2022.3.16f1, FmodUnity 2.02.19, Editor and Player
I Have found some possible bug in RuntimeUtils.DebugLog

If you hit Stop in editor and there is some script that forces FMOD in “OnDisable” to spit out something to console, Whole editor hangs in infinite loop.

Getting instance of seittngs which is using Resources.Load in DebugLog functions and in that getter using that same function seems suspicious.

Relevant Editor log:

UnityException: Load can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don’t use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
at (wrapper managed-to-native) UnityEngine.ResourcesAPIInternal.Load(string,System.Type)
at UnityEngine.ResourcesAPI.Load (System.String path, System.Type systemTypeInstance) [0x00000] in :0
at UnityEngine.Resources.Load (System.String path, System.Type systemTypeInstance) [0x00006] in :0
at UnityEngine.Resources.Load (System.String path) [0x00001] in :0
at FMODUnity.Settings.Initialize () [0x0001a] in C:\Users\grafi\VRDungeonURP1\Assets\Plugins\FMOD\src\Settings.cs:270
at FMODUnity.Settings.get_Instance () [0x0000f] in C:\Users\grafi\VRDungeonURP1\Assets\Plugins\FMOD\src\Settings.cs:258
at FMODUnity.RuntimeUtils.DebugLogWarning (System.String message) [0x00001] in C:\Users\grafi\VRDungeonURP1\Assets\Plugins\FMOD\src\RuntimeUtils.cs:562
at FMODUnity.RuntimeManager.DEBUG_CALLBACK (FMOD.DEBUG_FLAGS flags, System.IntPtr filePtr, System.Int32 line, System.IntPtr funcPtr, System.IntPtr messagePtr) [0x0004d] in C:\Users\grafi\VRDungeonURP1\Assets\Plugins\FMOD\src\RuntimeManager.cs:95
at (wrapper native-to-managed) FMODUnity.RuntimeManager.DEBUG_CALLBACK(FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr)
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
UnityEngine.<>c:b__0_0(Object, UnhandledExceptionEventArgs)
UnityEngine.ResourcesAPIInternal:Load(String, Type)
UnityEngine.ResourcesAPI:Load(String, Type)
UnityEngine.Resources:Load(String, Type)
UnityEngine.Resources:Load(String)
FMODUnity.Settings:Initialize() (at Assets\Plugins\FMOD\src\Settings.cs:270)
FMODUnity.Settings:get_Instance() (at Assets\Plugins\FMOD\src\Settings.cs:258)
FMODUnity.RuntimeUtils:DebugLogWarning(String) (at Assets\Plugins\FMOD\src\RuntimeUtils.cs:562)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets\Plugins\FMOD\src\RuntimeManager.cs:95)

(Filename: Assets/Plugins/FMOD/src/Settings.cs Line: 270)

exception inside UnhandledException handler: (null) assembly:C:\Program Files\Unity\Hub\Editor\2022.3.16f1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll type:UnityException member:(null)

Thanks for reporting this, it appears to be related to another Q&A case: [BUG] Settings.Instance doesn't check its current thread before calling Resources.Load.

We are currently working on this and aim to have it fixed in an upcoming release.