Unity-Minimum-Window-Size
Unity-Minimum-Window-Size copied to clipboard
System quit will causing access violation crash
Platform: All Windows 10 or above Build version: Unity 2018.4.x, 2020.3.x How to use: embedding this script into the project, and set the minimum window size when launch the application. Reproduce step:
- Launch the built application.
- Wait until it fully initialized.
- Using system quit(Alt+F4, click the X button of the window).
Expect Result: Exit normally, return exit code 0. Actual result: Crash, reason: access violation.
We put a fix that add this when launch: Application.wantsToQuit += () => { MinimumWindowSize.Reset(); return true; }; The built application doesn't get crash report any more, but the exit code is still return 0x0C, which is the access violation exit code.
However, when use Application.quit() to exit the application, it can successfully exit and returen exit code 0.