[cuegui] Fix crash when closing preview dialog before images are ready#2395
Conversation
- Closing the "Waiting for preview images..." dialog before the preview images were ready crashed the app with "QThread: Destroyed while thread is still running" / Aborted. - The close handler only set the watch thread's terminate flag without waiting for the QThread to exit, so the thread (parented to the dialog) was destroyed mid-execution, which Qt treats as a fatal error. - Fix PreviewProcessorDialog.__close to stop the thread and wait() for it to finish before the dialog is destroyed, and guard against the thread not yet existing. - Make PreviewProcessorWatchThread.run sleep in small slices so it reacts to stop() promptly instead of freezing the GUI for up to a second, and move the timeout check before the sleep.
📝 WalkthroughWalkthroughThe PR fixes thread lifecycle management in the Preview widget. ChangesThread Lifecycle Management
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@DiegoTavares / @lithorus |
c1ad07c
into
AcademySoftwareFoundation:master
Related Issues
Summarize your change.