Unity-Minimum-Window-Size icon indicating copy to clipboard operation
Unity-Minimum-Window-Size copied to clipboard

System quit will causing access violation crash

Open Yuuon opened this issue 4 years ago • 0 comments

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:

  1. Launch the built application.
  2. Wait until it fully initialized.
  3. 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.

Yuuon avatar Mar 29 '22 01:03 Yuuon