We have just upgraded a large project from Unity 5.4 to 5.5 and our desktop build crashes when exiting the application. This only and always happens when in fullscreen mode. In the “main menu” scene where one can exit all threads and all resources have been let go and this happens even if only starting the application and exiting directly without starting to use any resources.
What we have tried:
Build and run on two different machines, same results
Reverting to old version and building on Unity 5.4, no crash
Quitting using
if (!Application.isEditor) System.Diagnostics.Process.GetCurrentProcess().Kill(); instead, no crash. I’d prefer quitting a bit more gracefully though…
Looking through the crash and log file, nothing interesting
Run the build in windowed mode, no crash
Create a new empty project and try to recreate the problem, no crash
I can’t share the project (corporate stuff) and it is too large anyway.
Is anyone else experiencing similar issues or is this a one off thing?
Any ideas?
As I can’t recreate the issue I haven’t made a ticket for it, thought I’d try to figure out what causes it first…
I have been having the same issue. I have resorted to prefabing a scene and bringing in things one by one and retesting but there is no indication of why this is happening.
I have the same issue on unity 5.4.3f1 - Application.Quit() causes a crash only in full screen mode. Only the PC standalone build is affected, not the mac or linux builds. I suspect this has something to do with direct3D. I have found an effective workaround is to change the build settings D3D9 fullscreen mode and D3D11 fullscreen mode from ‘exclusive mode’ to ‘fullscreen window’, this prevents the crash.
So as I said earlier I re-prefabed and entire huge scene and re-built again and again bring in one component and or system one by one. You would not believe I found a fusion reactor core I made out of primitives using the standard shader. It had a transparent, a metallic and a particle system inside it. It also had no scripts attached to it. It would crash when ever I added this game object to the scene, either while loading into or always when exiting the game or even leaving the scene was using 5.5.0f3. I upgraded to 5.5.1f1and it completely went away I changed nothing and thought I was going mad. Looking though the fixes, and just the crashes from 5.5.0f3 > 5.5.1f1 > I could have had at least 5 “crashes fixed” found here https://unity3d.com/unity/whats-new/unity-5.5.1
Same problem here since we upgraded from 5.3 to 5.5.1p3. Before upgrading we had no problems with this and we launch our game today on Steam!! So the game will include this problem. As OP, logs are fine, no errors. Sometimes it works, others not…
P.S.: Btw, I’ve D3D9 and D3D11 set as “Fullscreen Window”
Just scouring forum for crashes that are similar to the one we’re having (thread here: Crash during Scene Change / Unload ) and there are some similarities it seems, and we’ve experienced this same issue (crash on exit) though it isn’t the one we’re actively fire-fighting at the moment.
Sorry can’t be of more help, but figured we’d toss our hat in the ring as well. =(
Hoping this will be helpful to someone–I’ve run into a similar problem, and I’ve discovered that freezing on Application.quit can be a symptom of a memory leak.
I’ve run a few tests; if you make an empty project that contains a single object that does something memory-leaky (say, instantiating 100 new materials every frame), and then call Application.Quit, the game will freeze.
Hello, in case this matches someone’s problem, in my case I used StreamReader and forgot to dispose it. (Or forgot to using over it) In this case what happening is the game close properly on the first try but not the 2nd time. It is as if some read lock persiss across process.
I have a freeze on quit in 2021.1.24.f1, for me it was the new input system. I created an empty project and switched between “Input System Package”, “Input Manager” and “Both”. When building for standalone windows the application quits as expected only with the “Input Manager (Old)” setting.