fix: keep UpdateCheckWorker alive until its thread finishes (#32) #42

Merged
the_og merged 1 commits from fix/32-about-worker-lifetime into main 2026-07-12 13:00:22 -04:00
Owner

Closes #32.

Closing the About dialog while a "Check for updates" request was in flight GC'd the dialog and the running QThread, aborting with QThread: Destroyed while thread is still running. Reproduced on unpatched main with an offscreen QApplication and a slowed fetch_latest_release; the same script passes with this fix (keepalive verified released after the thread finishes).

Fix: a class-level _live set holds every UpdateCheckWorker until its finished signal fires. Callers may drop their reference at any time; a result delivered to a destroyed receiver is silently discarded by Qt. Covers both the About dialog and the silent startup check with zero call-site changes.

Tests + ruff clean.

🤖 Generated with Claude Code

Closes #32. Closing the About dialog while a "Check for updates" request was in flight GC'd the dialog **and the running QThread**, aborting with `QThread: Destroyed while thread is still running`. Reproduced on unpatched main with an offscreen QApplication and a slowed `fetch_latest_release`; the same script passes with this fix (keepalive verified released after the thread finishes). Fix: a class-level `_live` set holds every `UpdateCheckWorker` until its `finished` signal fires. Callers may drop their reference at any time; a result delivered to a destroyed receiver is silently discarded by Qt. Covers both the About dialog and the silent startup check with zero call-site changes. Tests + ruff clean. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
the_og added 1 commit 2026-07-12 12:59:32 -04:00
fix: keep UpdateCheckWorker alive until its thread finishes (#32)
CI / Lint (ruff) (pull_request) Successful in 7s
CI / Tests (py3.10) (pull_request) Successful in 8s
CI / Tests (py3.12) (pull_request) Successful in 8s
bb355dac31
Closing the About dialog mid-check GC'd the dialog and the running
QThread with it -> 'QThread: Destroyed while thread is still running'.
A class-level keepalive set now holds each worker until finished;
stale results to a destroyed receiver are dropped by Qt.

Closes #32

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
the_og merged commit 1087fc84d1 into main 2026-07-12 13:00:22 -04:00
the_og deleted branch fix/32-about-worker-lifetime 2026-07-12 13:00:22 -04:00
Sign in to join this conversation.