Skip to content

Commit

Permalink
Hopefully improve sd stability
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonarddeR committed Jul 24, 2023
1 parent 4e066c1 commit fea562d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions addon/globalPlugins/nvdaRd/secureDesktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ class SecureDesktopHandler(AutoPropertyObject):
_ioThreadRef: weakref.ReferenceType[IoThread]
_brailleHandler: RemoteBrailleHandler
_speechHandler: RemoteSpeechHandler
_terminating: bool = False

def _handleRemoteDisconnect(self, handler: RemoteHandler, error: int) -> bool:
if self._terminating:
return True
if isinstance(WinError(error), BrokenPipeError):
ioThread = self._ioThreadRef()
pipeName = handler._dev.pipeName
Expand All @@ -43,6 +46,7 @@ def __init__(self, ioThread: IoThread):
self._speechHandler = self._initializeHandler(RemoteSpeechHandler)

def terminate(self):
self._terminating = True
self._speechHandler.terminate()
braille.handler.display.loadSettings()
self._brailleHandler.terminate()
Expand Down

0 comments on commit fea562d

Please sign in to comment.