From 387dae140ff50679921c19d60cfb0e5ccb36d35a Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Tue, 19 Apr 2016 12:15:45 +0200 Subject: [PATCH] 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 --- NetworkPrinterOutputDevice.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/NetworkPrinterOutputDevice.py b/NetworkPrinterOutputDevice.py index f17ea99143..21a5e14672 100644 --- a/NetworkPrinterOutputDevice.py +++ b/NetworkPrinterOutputDevice.py @@ -65,7 +65,6 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): self.setProgress(print_job_reply.json()["progress"]) else: self.setProgress(0) - except Exception as e: self.setConnectionState(ConnectionState.error) @@ -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")