From a8a475a1a7da4e83ec808ffec932d100d7012af1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 24 Jul 2017 17:18:04 +0200 Subject: [PATCH] Only stop the camera if the timer is actually running CURA-4081 --- .../NetworkPrinterOutputDevice.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index b14737a2a3..373521b4e9 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -313,15 +313,16 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): return True def _stopCamera(self): - self._camera_timer.stop() - if self._image_reply: - try: - self._image_reply.abort() - self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) - except RuntimeError: - pass # It can happen that the wrapped c++ object is already deleted. - self._image_reply = None - self._image_request = None + if self._camera_timer.isActive(): + self._camera_timer.stop() + if self._image_reply: + try: + self._image_reply.abort() + self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress) + except RuntimeError: + pass # It can happen that the wrapped c++ object is already deleted. + self._image_reply = None + self._image_request = None def _startCamera(self): if self._use_stream: