mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Added exception handling for when wrapped reply object is already deleted
CURA-2295
This commit is contained in:
parent
f2e93bfd97
commit
93cc25b408
1 changed files with 20 additions and 14 deletions
|
@ -252,13 +252,16 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
self._connection_message.show()
|
self._connection_message.show()
|
||||||
# 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.
|
||||||
if self._post_reply:
|
try:
|
||||||
self._post_reply.abort()
|
if self._post_reply:
|
||||||
try:
|
self._post_reply.abort()
|
||||||
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
|
try:
|
||||||
except TypeError:
|
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
|
||||||
pass # The disconnection can fail on mac in some cases. Ignore that.
|
except TypeError:
|
||||||
self._progress_message.hide()
|
pass # The disconnection can fail on mac in some cases. Ignore that.
|
||||||
|
self._progress_message.hide()
|
||||||
|
except RuntimeError:
|
||||||
|
self._post_reply = None # It can happen that the wrapped c++ object is already deleted.
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
self._recreate_network_manager_count = 1
|
self._recreate_network_manager_count = 1
|
||||||
|
@ -273,13 +276,16 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice):
|
||||||
self._connection_message.show()
|
self._connection_message.show()
|
||||||
# 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.
|
||||||
if self._post_reply:
|
try:
|
||||||
self._post_reply.abort()
|
if self._post_reply:
|
||||||
try:
|
self._post_reply.abort()
|
||||||
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
|
try:
|
||||||
except TypeError:
|
self._post_reply.uploadProgress.disconnect(self._onUploadProgress)
|
||||||
pass # The disconnection can fail on mac in some cases. Ignore that.
|
except TypeError:
|
||||||
self._progress_message.hide()
|
pass # The disconnection can fail on mac in some cases. Ignore that.
|
||||||
|
self._progress_message.hide()
|
||||||
|
except RuntimeError:
|
||||||
|
self._post_reply = None # It can happen that the wrapped c++ object is already deleted.
|
||||||
self.setConnectionState(ConnectionState.error)
|
self.setConnectionState(ConnectionState.error)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue