Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not assign the patched speak function to None #14

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

CyrilleB79
Copy link
Contributor

Steps to reproduce the issue

  • install both Baidu Translation and and Clipboard Enhancement and restart
  • Press NVDA+control+f3 to reload the add-ons

Result

NVDA cannot speak anymore

Probable explanation

When multiple add-ons patch speech.speak, we cannot consider that we have a reliable order to ensure that add-on 1 patches first and unpatch last with respect to add-on 2.

Solution

Do not set the patch function variable to None. when therminating the add-on.
We probably end up with not all speak functions being unpatched, but that still much better than having an error on each speak call.

Note

With NVDA 2024.2, there will be an extension point for the speak function which will be much cleaner.

@cary-rowen
Copy link
Owner

Thanks to @CyrilleB79 for contributing to this.
I'm happy to merge it.

@cary-rowen cary-rowen merged commit feb2d55 into cary-rowen:master Apr 16, 2024
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.

None yet

2 participants