Search Unity

Freezes during assembly reload on Windows 10

Discussion in 'Editor & General Support' started by GlickWick, May 24, 2017.

  1. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Been having a ton of issues with this lately (currently on Unity 5.6.1f1, but the issue began somewhere in 5.5.x for me).

    Whenever I modify the code for a mid-sized project in Visual Studio Community 2017, there's like a 10% chance Unity will freeze while reloading assemblies. This requires a force quit, and is really disruptive. It can also result in scene changes not being saved, and thus lost work.

    No anti-virus installed, and don't have issues with other platforms. Also the same project has no issues on OSX using Visual Studio Code.
     
  2. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
  3. GlickWick

    GlickWick

    Joined:
    Jan 16, 2014
    Posts:
    17
    Figured out what's happening here, but not sure how to fix it.

    This is being caused by a network thread hanging. I use Gamesparks, and OnApplicationQuit I call GS.Disconnect(), which takes care of these threads normally.

    However, if there's an error in the game, like an NPE, and I stop the game afterwards, OnApplicationQuit won't get called, and this can cause Gamesparks network threads to hang and stay open.

    Is there any way to force these threads to close when the game throws an error in Editor mode?