Browse Source

Added extra exception catching for thread joining

Jaime van Kessel 9 years ago
parent
commit
7fda5c84e7
1 changed files with 5 additions and 1 deletions
  1. 5 1
      plugins/USBPrinting/PrinterConnection.py

+ 5 - 1
plugins/USBPrinting/PrinterConnection.py

@@ -241,7 +241,11 @@ class PrinterConnection(SignalEmitter):
     ##  Close the printer connection    
     def close(self):
         if self._connect_thread.isAlive():
-            self._connect_thread.join()
+            try:
+                self._connect_thread.join()
+            except Exception as e:
+                pass # This should work, but it does fail sometimes for some reason
+
         if self._serial is not None:
             self.setIsConnected(False)
             self._listen_thread.join()