- Home /
Unity 5.3 freezes when switching window focus back to it
I open a project in 5.3.0f1 or 5.3.1f1 (tried both), and then briefly switch to another window (say Explorer, Visual Studio, or MonoDevelop). 90% of the time I switch back to Unity, the editor freezes indefinitely. Not crashed (task manager shows it running), but I can't close the window, minimize it, or do anything inside the editor. The only thing I can do is to End Task. I have windows 10 pro.
I think I isolated the problem. I'm using Photon Server, and it seems that Unity freezes when reaching the line Peer.Connect(serverAddress, applicationName). I'll post the problem on their forums as well.
Answer by Merricat · Dec 20, 2015 at 05:44 PM
I'm pretty sure I've figured out the problem. I realized the problem occurred after playing the game at least once in the editor. That meant that the peer.connect() needed to happen at least once. Once I added a peer.Disconnect() on OnApplicationQuit() then the editor stopped crashing. My fault for thinking it would be somehow handled automatically - woops!
Hy!
I've got this same problem with 2019.1 version of unity. How you can modify the OnApplicationQuit() function?
Thanks, Csaba
Your answer
![](https://koobas.hobune.stream/wayback/20220612053233im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity forces me to restart my computer after every crash in order to reopen it. 1 Answer
Unity2018.2 : Gfx.WaitForPresent() causes rendering to freeze when (Windows10) app looses focus 1 Answer
Unity freezes my computer everytime I bring focus to an element inside the Unity form 3 Answers
Unity freezes on white/black window when I open Build Settings, Modules and Import Packages 4 Answers
Unity Editor text 1080p 2 Answers