Post reply is now set to None after abort

CURA-2295
This commit is contained in:
Jaime van Kessel 2016-09-19 13:38:52 +02:00
parent 66b22134ba
commit 7da05e0f36

View file

@ -297,7 +297,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
if self._progress_message: if self._progress_message:
self._progress_message.hide() self._progress_message.hide()
# Check if we were uploading something. Abort if this is the case. # Check if we were uploading something. Abort if this is the case.
# Some operating systems handle this themselves, others give weird issues. # Some operating systems handle this themselves, others give weird issues.
try: try:
@ -309,6 +309,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
pass # The disconnection can fail on mac in some cases. Ignore that. pass # The disconnection can fail on mac in some cases. Ignore that.
self._post_reply.abort() self._post_reply.abort()
self._post_reply = None
except RuntimeError: except RuntimeError:
self._post_reply = None # It can happen that the wrapped c++ object is already deleted. self._post_reply = None # It can happen that the wrapped c++ object is already deleted.
return return
@ -339,6 +340,7 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
pass # The disconnection can fail on mac in some cases. Ignore that. pass # The disconnection can fail on mac in some cases. Ignore that.
self._post_reply.abort() self._post_reply.abort()
self._post_reply = None
except RuntimeError: except RuntimeError:
self._post_reply = None # It can happen that the wrapped c++ object is already deleted. self._post_reply = None # It can happen that the wrapped c++ object is already deleted.
self.setConnectionState(ConnectionState.error) self.setConnectionState(ConnectionState.error)