UpdateThread now only joins when it's actually running

An output device can be created and never have it's connect called.
Because the delete of the output device calls close, we need to handle this

CURA-49
This commit is contained in:
Jaime van Kessel 2016-04-19 12:15:45 +02:00
parent 1a44c394e1
commit 387dae140f

View file

@ -66,7 +66,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
else:
self.setProgress(0)
except Exception as e:
self.setConnectionState(ConnectionState.error)
Logger.log("w", "Exception occured while connecting; %s", str(e))
@ -86,8 +85,9 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def close(self):
self._connection_state == ConnectionState.closed
self._update_thread.join()
self._update_thread = None
if self._update_thread != None:
self._update_thread.join()
self._update_thread = None
def requestWrite(self, node, file_name = None, filter_by_machine = False):
self._file = getattr(Application.getInstance().getController().getScene(), "gcode_list")