[orca: 1/2] braille: on initialization error, make sure to clean BrlAPI connection



commit fb7b74c68bb857a70a2354fb2f82dd06dfce24a3
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed Dec 19 17:52:57 2018 +0100

    braille: on initialization error, make sure to clean BrlAPI connection

 src/orca/braille.py | 9 +++++++++
 1 file changed, 9 insertions(+)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index d07fa3920..37e9281d2 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -1694,6 +1694,15 @@ def init(callback=None, tty=7):
         debug.println(debug.LEVEL_CONFIGURATION,
                       "Could not initialize BrlTTY:")
         debug.printException(debug.LEVEL_CONFIGURATION)
+        try:
+            _brlAPI.leaveTtyMode()
+        except:
+            pass
+        try:
+            _brlAPI.closeConnection()
+        except:
+            pass
+        _brlAPI = None
         _brlAPIRunning = False
         return False
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]