0
1
mirror of https://github.com/radio95-rnt/RadioPlayer.git synced 2026-02-26 21:53:54 +01:00

diffrent way of shutdown catch

This commit is contained in:
2025-12-06 23:20:05 +01:00
parent 89bbb53c51
commit a931e5aad3

View File

@@ -305,7 +305,10 @@ def main():
log_file_path.touch()
core = RadioPlayer((" ".join(sys.argv[1:]) if len(sys.argv) > 1 else None), open(log_file_path, "w"))
atexit.register(core.shutdown)
core.start()
signal.signal(signal.SIGINT, core.handle_sigint)
core.loop()
try:
core.start()
signal.signal(signal.SIGINT, core.handle_sigint)
core.loop()
except SystemExit:
core.shutdown()
raise