Skip to content

Qt thread safety - #1575

Merged
dxqb merged 2 commits into
Nerogar:mergefrom
dxqb:qt-thread-safety
Jul 4, 2026
Merged

Qt thread safety#1575
dxqb merged 2 commits into
Nerogar:mergefrom
dxqb:qt-thread-safety

Conversation

@dxqb

@dxqb dxqb commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Qt is stricter that Ctk with regards to thread safety. Do all UI calls only from the main thread, not from the training thread (and not from the video tool worker thread CC @efhosci)

Test plan

  • pre-commit run --all-files passes
  • Launched the affected UI or script and exercised the change

AI assistance

  • AI-assisted — I have read every line in this diff and can defend each change

dxqb and others added 2 commits July 4, 2026 06:46
sync_cloud_secrets() is called from the training thread when cloud setup
fails, but updated the UI state var directly, mutating a Qt widget off
the main thread. This causes an intermittent native segfault. Defer the
update via schedule_on_main_thread, matching the other training-thread
callbacks.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
update_status() and update_preview() are called from the video tool's
background worker thread but mutated QTextEdit/QLabel widgets directly,
risking the same native segfault as sync_cloud_secrets. Defer both
through a new schedule_on_main_thread helper.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dxqb
dxqb merged commit f610daf into Nerogar:merge Jul 4, 2026
1 check was pending
@dxqb
dxqb deleted the qt-thread-safety branch July 4, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant