Launcher: keep alive (#1894)

This commit is contained in:
Fabian Dill
2023-06-27 09:30:54 +02:00
committed by GitHub
parent a7bc8846cd
commit a4e485e297
2 changed files with 18 additions and 1 deletions

View File

@@ -223,6 +223,12 @@ def run_gui():
else:
launch(get_exe(button.component), button.component.cli)
def _stop(self, *largs):
# ran into what appears to be https://groups.google.com/g/kivy-users/c/saWDLoYCSZ4 with PyCharm.
# Closing the window explicitly cleans it up.
self.root_window.close()
super()._stop(*largs)
Launcher().run()
@@ -267,3 +273,9 @@ if __name__ == '__main__':
help="Pass either a patch file, a generated game or the name of a component to run.")
parser.add_argument('args', nargs="*", help="Arguments to pass to component.")
main(parser.parse_args())
from worlds.LauncherComponents import processes
for process in processes:
# we await all child processes to close before we tear down the process host
# this makes it feel like each one is its own program, as the Launcher is closed now
process.join()