Wait until GUI exits before starting new NVDA instance from installer (#12431)
NVDA (usually) crashes after a successful install. This occurs directly after "NVDA exit" is logged, and happens during the system exit process. Debugging the crash dump in #12421 finds that a window is processing an activate event after the wx app has been destroyed.
We know that:
the installer crashes at the end, when WM_QUIT is sent from another NVDA instance
the installer only crashes for non-silent installs, otherwise appveyor would be crashing regularly
I've found that:
the installer exits normally when another NVDA instance is started before the install finishes
running subsequent instances of NVDA exits the running instance using WM_QUIT without crashing
Description of how this pull request fixes the issue:
If we exit the GUI before starting the new instance of NVDA, then the new instance will not use WM_QUIT to exit the GUI. This PR adds a handler to start a new NVDA instance, to the NVDA exit event, after the wx mainloop is exited safely.