Added RunTime exception catching for image_reply

In some cases the c++ object is already deleted. If we just ignore it, nothing breaks.

CURA-3844
This commit is contained in:
Jaime van Kessel 2017-05-22 14:48:42 +02:00
parent c474642744
commit f9f0fa852f

View file

@ -306,8 +306,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
def _stopCamera(self):
self._camera_timer.stop()
if self._image_reply:
self._image_reply.abort()
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
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