Other user's assetsSome assets in this file belong to other authors. You will need to seek permission from these authors before you can use their assets
Upload permissionYou can upload this file to other sites but you must credit me as the creator of the file
Modification permissionYou are allowed to modify my files and release bug fixes or improve on the features without permission from or credit to me
Conversion permissionYou can convert this file to work with other games as long as you credit me as the creator of the file
Asset use permissionYou are allowed to use the assets in this file without permission or crediting me
Asset use permission in mods/files that are being soldYou are not allowed to use assets from this file in any mods/files that are being sold, for money, on Steam Workshop or other platforms
Asset use permission in mods/files that earn donation pointsYou are allowed to earn Donation Points for your mods if they use my assets
Author notes
This author has not provided any additional notes regarding file permissions
File credits
rathologic - original research into why the freeze happens
Donation Points system
Please log in to find out whether this mod is receiving Donation Points
The issue was in the fact that the GameWindow class has Unity event OnDisable() which handles the behaviour when a particular game object is disabled, usually meant to clean up references, delegates, etc. However, it is being called both on the gameobject being disabled while the game is still running (i.e. UI element being hidden, which I assume is what IPL wrote the code for) and on the object being disabled as the entire scene is being unloaded (which happens when the game quits and allows devs to execute some code before the application closes, e.g. to save progress). It turned out to be quite easy to check for which one of the two reasons is the function being called and only execute the problematic code when it is just the UI being hidden, not the game closing.
The original research about why this happens belongs to rathologic, I only provided the solution to distinguish between the window being disabled during gameplay and when closing the game.