aboutsummaryrefslogtreecommitdiffstats
path: root/sb_builder/jobs.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 19:23:11 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 19:23:11 +0200
commitc142168019f61776ba612fa05ac6a0adb17ba1e2 (patch)
tree12552a33a05f1a07d725eb331974269dd0fda73c /sb_builder/jobs.py
parent9c0a9b3c804e14e6d5193733f652b88ddd5abbaa (diff)
downloadsb-builder-c142168019f61776ba612fa05ac6a0adb17ba1e2.tar.gz
sb-builder-c142168019f61776ba612fa05ac6a0adb17ba1e2.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'sb_builder/jobs.py')
-rw-r--r--sb_builder/jobs.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/sb_builder/jobs.py b/sb_builder/jobs.py
index e0f906b..bcbd812 100644
--- a/sb_builder/jobs.py
+++ b/sb_builder/jobs.py
@@ -124,7 +124,11 @@ class JobsTab(QWidget):
def stop(self):
if self.proc:
p, self.proc = self.proc, None
+ # disconnect first: finished arrives later, maybe after this tab is deleted
+ p.readyReadStandardOutput.disconnect()
+ p.finished.disconnect()
p.kill()
+ p.deleteLater()
def start(self, *args):
self.remote.call(self._started, "job-start", *args)