From c142168019f61776ba612fa05ac6a0adb17ba1e2 Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Mon, 19 Oct 2026 19:23:11 +0200 Subject: Fix crash when closing the Jobs tab during a running job Closing the tab killed the job-follow process, whose finished signal arrived after the tab was deleted; the slot touched dead widgets and PyQt6 aborted the whole application on the unhandled exception. stop() now disconnects the process before killing it. A sys.excepthook logs any future slot exception to stderr instead of aborting. Co-Authored-By: Claude Opus 5.5 --- sb_builder/__main__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sb_builder/__main__.py') diff --git a/sb_builder/__main__.py b/sb_builder/__main__.py index 5a78b64..ae8e89a 100644 --- a/sb_builder/__main__.py +++ b/sb_builder/__main__.py @@ -17,6 +17,7 @@ """Entry point: python3 -m sb_builder.""" import sys +import traceback from PyQt6.QtWidgets import QApplication, QMessageBox @@ -26,6 +27,8 @@ from .remote import Remote def main(): + # PyQt aborts on an exception escaping a slot unless a hook is set: log it instead + sys.excepthook = traceback.print_exception app = QApplication(sys.argv) app.setApplicationName("sb-builder") cfg, err = config.load() -- cgit v1.2.3