v0.87.1: one app icon (lint.jpg, wave's corner radius) on desktop and andTunes 0.4.2; quitting no longer segfaults
The swap-a-PNG icon is gone: scripts/make_icons.py renders packaging/lint.jpg into packaging/lintunes.png and the andTunes launcher. Quitting ends with os._exit once aboutToQuit has saved everything — Python's teardown of the QApplication wrapper segfaulted on every quit.
This commit is contained in:
+18
-1
@@ -191,7 +191,24 @@ def run_gui(data_dir: Path, files: list[Path],
|
||||
exit_code = app.exec()
|
||||
if window.restart_requested:
|
||||
return True # caller re-execs the updated code
|
||||
sys.exit(exit_code)
|
||||
leave(exit_code)
|
||||
|
||||
|
||||
def leave(exit_code: int):
|
||||
"""End the process once the event loop is done, without Python tearing
|
||||
down the Qt objects. Everything is already saved by then (aboutToQuit
|
||||
flushed the library, the player shut down), but a normal exit then
|
||||
frees the QApplication's wrapper in no particular order, and sip touched
|
||||
a QObject Qt had already deleted: a segfault and a core dump on every
|
||||
quit (2026-10-27, 2026-11-06; four out of four on the dev library)."""
|
||||
import logging
|
||||
logging.shutdown()
|
||||
for stream in (sys.stdout, sys.stderr):
|
||||
try:
|
||||
stream.flush()
|
||||
except (OSError, ValueError):
|
||||
pass
|
||||
os._exit(exit_code)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user