Don't try to disconnect after aborting

Because if the signal is not connected then we'd get a segfault in this case.

Contributes to issue CURA-4376.
This commit is contained in:
Ghostkeeper 2017-10-02 17:34:49 +02:00
parent 1aa6d2876c
commit 6fc62fd2b3
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -331,13 +331,14 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
if self._camera_timer.isActive():
self._camera_timer.stop()
else: #Camera wasn't even running. Don't try to stop it or you'll get a segfault.
return
if self._image_reply:
try:
try:
self._image_reply.downloadProgress.disconnect(self._onStreamDownloadProgress)
except TypeError:
pass #The signal was never connected.
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