dictation-toolbox / natlink

Natlink provides the interface between Dragon and python
https://dictation-toolbox.github.io/natlink/
Other
25 stars 17 forks source link

Fix two grammar callbacks that silently fail out-of-process #210

Closed drmfinlay closed 1 month ago

drmfinlay commented 1 month ago

I made this change a month ago. I figure it should probably be submitted on its own.

Commit text:

The grammar recognition and hypothesis callbacks have been silently failing on Windows 10 when Natlink is used in a separate Python process. Holding the GIL during the callbacks and making a minor change in the natConnect() function fixes this problem.

The error may be reproduced out of process using a loaded grammar and the waitForSpeech() function. The Dragon log should have a line or two saying that client process python.exe failed with error RPC_E_SERVERFAULT.

LexiconCode commented 1 month ago

Thank you for this! I will verify that out of process runs.