Conversation
WalkthroughThe recent changes enhance the shutdown process of the NVDA application by adjusting thread management. In Changes
Recent review detailsConfiguration used: .coderabbit.yml Files selected for processing (2)
Additional context usedPath-based instructions (2)
Learnings (2)
Additional comments not posted (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Link to issue number:
Improves fix for #16933
Improves upon pr #16934
Summary of the issue:
In PR #16934, it was ensured that NVDA's mutex would not be released until all remaining non-daemon threads were joined and completed. Otherwise, the NVDA process may stay around because of remaining background threads, such as the Braille auto detector worker thread.
However, the joining of the threads was done after NVDA's message window was destroyed, therefore making it impossible for a new instance of NVDA to locate and kill off the old NVDA if it truly was taking way too long.
Description of user facing changes
An old NvDA has more chance of being killed off if it is taking too long to exit when a new copy of NVDA is trying to start.
Description of development approach
Move the joining of the non-daemon threads out of nvda.pyw, and into the bottom of core.main. Also ensure that destroying the message window is the very last action taken. So the ordering of the end of core.main is now:
Testing strategy:
Reproduced steps in #16933.
Temporarily added a time.sleep(10) after joining the threads, and ensured that a new copy of NVDA could successfully kill off the old copy.
Known issues with pull request:
None known.
Code Review Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Chores