mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
393 stars 113 forks source link

Run exit_command at end of main() #742

Closed mbarnes closed 1 year ago

mbarnes commented 1 year ago

The exit command can cause Attract-Mode to be terminated by the operating system before it can gracefully exit on its own, such as when the exit command shuts down the system. In particular, feSettings.save_state() may get skipped or aborted with a half- written attract.am.

Instead, run the exit command as the final act of main() after exiting the main loop and cleaning up resources. And pass the command's exit code through as Attract-Mode's exit code.

mickelson commented 1 year ago

thanks!