A while ago I upgraded to Unity 2022.3.6f1, Burst 1.8.8, Entities 1.0.14. From that point, my application began crashing on exit. Since then I've tried upgrading further to Unity 2022.3.8f1.
The crash logs haven't given me any information that I can usefully discern, but have been attached anyway.
So what I did was breakpoint the Application.quitting callback and step through code execution, one step at a time, until the crash occurred 😅 It ended up in Unity.Entities.RuntimeContentManager, specifically the Cleanup method, and more specifically the call to Resources.UnloadUnusedAssets();, which I couldn't dig into any further.
I could see that cleanup was dealing with some shared static business, so thought maybe there was something wrong with my usage of shared statics (maybe left uninitialised or something) that could be causing it. So I commented out ALL of my shared static definitions and got code compiling again, but the crash persisted.
Then, considering that it was a Resources.Unload call crashing, I thought maybe my Resources (I use a couple of them for application-lifetime manager objects) were problematic somehow. So I deleted them all from the project - game's now got lots of exceptions being thrown - but the same crash still persisted on Alt+F4.
Now, without any shared statics or resources (except 3rd-party / plugin ones), I'm left without any leads.
Has anybody else seen this error? Any further suggestions on how I can try to get to the bottom of it?
One further thing I'll note is that this crash is happening on the main menu, which hasn't even created an ECS world yet. I create my the ECS world myself instead of using the default Unity one, and that's driven from a MonoBehaviour in the match scene which has never come into existence when I'm doing this test crash from the menu.